ExitPoll 0.1
ExitPoll uses Google Analytics to keep track of users leaving your site, or downloading files. It works with either the synchronous, or asynchronous Google Analytics tracking code.
Details
- Author
- Caleb Crane
- Current version
- 0.1
- GitHub
- simulacre/ExitPoll
- Downloads
- 1632
- Category
- Utilities
- Tags
- Report
- GitHub Issues
How to use
- Install the Google Analytics tracking code as usual. The asynchronous and synchronous versions are both supported.
Instantiate an ExitPoll object once the DOM is ready:
window.addEvent("domready", function(){ new ExitPoll(); });
ExitPoll will then bind mouseup events on all links that point to another server, different port on the same server, or non-html file on the same server. Mailto links will also be caught. When the user clicks on one of the links, and does not cancel the click, ExitPoll will register a PageView with Google Analytics. Outgoing links will be prepended with "/outgoing/". Download links will be prepended with "/download/".

Syntax
new ExitPoll([options]);
Arguments
1. options - (object, optional) the options described below:
Options
- parent : (element) An element that is the parent of all the links that you want to track. Defaults to document.body.
- fileTypes : (array) The list of file extensions that should be tracked as downloadable files. Defaults to: [ "pdf", "zip", "rar", "tgz", "gz","gzip", "jpg", "png", "svg", "gif", "doc", "eps", "xls", "ppt", "xls", "txt", "vsd", "js", "css", "rar", "exe", "wma", "mov", "avi", "wmv", "mp3"]
- event : (string) The type of event to bind the tracking action to:
- click - Fires when the user clicks on the link. Pros: canceled clicks will not be tracked. Cons: middle button clicks will not be tracked
- mousedown - Fires when the user pushes down on the link. Pros: middle clicks will be tracked. Cons: canceled clicks will be tracked
- mouseup - default Pros: middle clicks will be tracked and canceled clicks will not be tracked. Cons: ...
Discuss
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus