Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Prevent GA to report too high of a bounce rate for your "one page at one visit" site (a landing page or a blog)
$.domReady(function(){
// Fire an event so that GA doesn't count it as a "bounce"
// http://blog.popcornmetrics.com/why-your-google-analytics-bounce-rate-is-wrong-and-how-to-fix-it/
function readPage() {
ga('send', {
'hitType': 'event',
'eventCategory': 'engagement',
'eventAction': 'read'
});
}
var readPageTime = 60 * 1000;
setTimeout(readPage, readPageTime);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.