Our event tracking is flexible and we allow our clients to make up events and then use for segmentation if they want to. e.g.:
- "I want to track when people are signing up or looking at swatches instead of furniture".
- "I want to track people who watched a webinar (viewed a specific page) and follow up with special abandons for them".
- "I want to track people who have submitted a specific form or reached a specific step in the signup process"
All you have to do for this is fire the Custom Event wave code (minus the 'setParams' line), and use whatever action name you want for the 'setAction' call.
Custom event details
In addition to our standard events tracking, we are also able to track custom events. Two calls will need to be added to the /*** EVENT SPECIFIC CODE ***/ section:
- Call
_setAction
and provide a name (snake case string) as the value. The action name can only use lower case letters, space, underscore, and dash. No upper case letters or numbers are allowed. - Call
_setParams
and provide any useful parameters as the values for this custom event
/*** EVENT SPECIFIC CODE ***/ _rsq.push(['_setAction', 'category_view']); // custom event _rsq.push(['_setParams', {'id': 'category_id', 'name':'category_name'}]); // custom event params
/*** END EVENT SPECIFIC CODE ***/
Custom event code sample
<!-- RetentionScience start -->
<script type='text/javascript'>
var _rsq = _rsq || [];
_rsq.push(['_setSiteId', 'site_id']); // replace site_id with your static Site ID
_rsq.push(['_enableOnsite']);
if (condition) { // replace condition with your parameters for checking if a user is logged in
_rsq.push(['_setUserId', 'user_id']); // replace user_id with your dynamic user_id variable
_rsq.push(['_setUserEmail','user_email']); // replace user_email with your dynamic user_email variable
}
/*** EVENT SPECIFIC CODE ***/
_rsq.push(['_setAction', 'category_view']); // custom event
_rsq.push(['_setParams', {'id': 'category_id', 'name': 'category_name'}]); // custom event params
/*** END EVENT SPECIFIC CODE ***/
_rsq.push(['_track']);
(function() {
var rScix = document.createElement('script');
rScix.type = 'text/javascript';
rScix.async = true;
rScix.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'd1stxfv94hrhia.cloudfront.net/waves/v3/w.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(rScix);
})();
</script>
<!-- RetentionScience end -->
Reserved action names
The following actions are reserved. Please do not try to use these names as custom actions.
- click
- view
- email_open
- email_click
- shopping_cart
- checkout_success
- search
Comments
0 comments
Please sign in to leave a comment.