Using Events to Improve Bounce Rate in Google Analytics

By  on  

The bounce rate cited by Google Analytics for this blog has always been high and it's been discouraging.  Having a high bounce rate is bad, right?  Or does that mean someone found what they needed and left, which would be a win?  I'm not sure, but I was recently told that some people use event tracking to find a truer bounce rate.  If a user scrolls or clicks on something, that shouldn't be a bounce, right?  They're certainly interacting with the page!  With my redesign, I implemented this:

function removeEvents() {
	document.body.removeEventListener('click', sendInteractionEvent);
	window.removeEventListener('scroll', sendInteractionEvent);
}

function sendInteractionEvent() {
	ga('send', 'event', 'Page Interaction');
	removeEvents();
}

document.body.addEventListener('click', sendInteractionEvent);
window.addEventListener('scroll', sendInteractionEvent);

After adding this code, my bounce rate went down dramatically.  Tracking an event isn't gaming the system so I find this situation a bit odd.  Why does tracking an event, not firing a pageview, affect the bounce rate so much?  I'm not sure, maybe you can tell me!

Preventing Events from Affecting Bounce Rate

Let's say you don't want events to affect your bounce rate; you can use the following to do so:

ga('set', 'nonInteraction', true);

It's odd to me that an event would effect bounce rate, if the definition of a bounce rate is a user going to your site and immediately leaving. A pageview is not an event so....weird!

Recent Features

  • By
    JavaScript Promise API

    While synchronous code is easier to follow and debug, async is generally better for performance and flexibility. Why "hold up the show" when you can trigger numerous requests at once and then handle them when each is ready?  Promises are becoming a big part of the JavaScript world...

  • By
    fetch API

    One of the worst kept secrets about AJAX on the web is that the underlying API for it, XMLHttpRequest, wasn't really made for what we've been using it for.  We've done well to create elegant APIs around XHR but we know we can do better.  Our effort to...

Incredible Demos

  • By
    Reverse Element Order with CSS Flexbox

    CSS is becoming more and more powerful these days, almost to the point where the order of HTML elements output to the page no longer matters from a display standpoint -- CSS lets you do so much that almost any layout, large or small, is possible.  Semantics...

  • By
    Jack Rugile’s Favorite CodePen Demos

    CodePen is an amazing source of inspiration for code and design. I am blown away every day by the demos users create. As you'll see below, I have an affinity toward things that move. It was difficult to narrow down my favorites, but here they are!

Discussion

  1. This is nice. I recently found this jQuery plugin (yeah, one likes mootools more ^^) http://scrolldepth.parsnip.io/ wich is firing every 25% of pagescroll.

    This way it’s more comfortable to tell if the quality is good. More Events = better content.

  2. Bounce rate depends on presence/absence of interaction. Navigating from one page of your blog to another counts as an interaction; scrolling, navigating to another website, playing a video on your website, etc does not count as interaction. You track such actions via events; and while doing so, you can choose if the event should be counted as an interaction or not.

  3. Joey

    Yes, but how/where is the code implemented? Do I just paste it anywhere in the site? Thanks.

  4. Leo

    Salman’s got it right.

    Google calculates a users time spent on a site by measuring the time between the first “hit” and last “hit”. The first “hit” happens when you load a page.

  5. Hi,
    The bounce rate is a nightmare for the webmasters, if it is on the higher side. In fact, the Google analytics is a best and free tool to stay informed about your website bounce rate.

    This article has the quality to assist many webmasters to understand the pros and cons of the bounce rate.

    Thanks for sharing a quality.
    kumar

  6. I disagree, I want my events to effect my bounce rate. I have a single page marketing site. So I register events on the menu items that are clicked to scroll to the next section. These are not bounces.

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!