The following are some key things to note about the Regular page view Javascript event:
- Outside of the normal shared concepts listed here, nothing special about this wave.
- It should be on every page on your website, as this also enables us to track every click the user performs and what pages they are most interested in (and browser/device information).
Regular page view event details
The sample code shown below is your starting template for all pages. Copy and paste this code into your HTML templates before the closing </head>
tag. There is nothing else required in the /*** EVENT SPECIFIC CODE ***/
section for a page view.
<!-- 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 ***/
// No event specific code required here for page views
/*** 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 -->
Comments
0 comments
Please sign in to leave a comment.