Documentation: Calls Reference
_trackMailTo
Track email links as "mailto" click events. Once this call is included you do not have to modify individual links to track them.
Simple call
_gaq.push(['_trackMailTo']);
Advanced call
_gaq.push(['_trackMailTo', {
onBounce: true, // optional boolean
method: 'event', // optional 'event'|'page'
category: 'mailto', // optional string
action: 'click', // optional 'click'|'mouseup'
value: 0, // optional real
include: /./, // optional regex
exclude: /^$/, // optional regex
selector: 'a', // optional jQuery selector
buttons: ['click','clickl','clickm','clickr']
}]);
Parameters
- onBounce true|false
- By default (true), the tracking will affect the bounce rate, If this option is false, the mailto link will not be tracked if happening on the first page view of a visit.
- method 'event'|'page'
- By default, mailto links are tracked as events. If any other value, a fake page view will be generated. This parameter default value is set to 'event'.
- category 'mailto'|string
- Mailto links are tracked with a Category, Action, optional Label and optional Value. This is the label that will show under the Content/Event Tracking/Categories report. If not using events, Category, Action and Label will be the faked page hierarchy represented as /Category/Action/Label. Label is the URL of the mailto link. This parameter default value is 'mailto'.
- action 'click'|'mouseup'
- The event label showing up under GA report /Content/Event Tracking/Actions.
If action is set to 'mouseup' then the left, middle and right mouse buttons will be tracked as well as the regular 'click' event. Be forewarned using 'mouseup' simply means those buttons were pressed, not that the link was actually followed (i.e. someone can press the right-button to "open in new window", "save as..." or nothing at all). This parameter default value is 'click'.
- value 0|real
- If using the event method, you can assign a value for this event. This parameter can not be used when method is set to 'page'. This parameter default value is 0.
- include /./|regex
- The include filter is used to narrow down which mailto links are to be tracked. This parameter default value is /./, meaning all mailto links will be tracked.
- exclude /^$/|regex
- The exclude filter can be used to exclude mailto link tracking for specific addresses. By default, nothing is excluded (/^$/ will always be false). For example, if you set this option to /@mydomain.com/ all mailto links will be tracked (based on the 'include' parameter filter) except those linking to email addresses of mydomain.com.
- selector 'a'|jQuery selector
- Advanced use only: allow you to specify an alternative jQuery selector.
- button ['click','clickl','clickm','clickr'] | string array
- A four items array that represent a generic button click, left-click, middle-click or rick-click labels