Bounce Rate. I think it’s a dumb metric, for the most part. It’s so dumb that there’s no point in “improving it” until you’ve fixed the way it’s reported. Here’s what I mean:

  • Person A visits my website. They spend 30 minutes reading my wonderful blog post and then they close the window. They get counted as a bounce, and their session is recorded as 0 time on-site.
  • Person B visits my website and spends 30s on the first page, but promptly finds the page they’re looking for. They leave after spending 30 minutes on that page. This isn’t a bounce, but the session is recorded as a 30s visit.
  • Person C visits my website and spend 30 minutes on the first page and moves onto a second page. They leave after spending 30s there. The session is recorded as a 30 minute visit, rather than a 30:30 visit.

Since we’re so wildly inaccurate with our reporting on bounce rate right now, let’s fix our reporting before we try to “fix our bounce rate” by messing with links and user experience and all of that.

The reason our bounce rate is so sloppy is because Google Analytics tracks interactions with a website only when interactive elements of the tracking snippet fire. When the page loads, a “Pageview” fires. In many cases, this is the only interactive element that is set up.

So, in the case of Person A, the “Pageview” fired when they arrived on the site, and, since they left before loading another page, Google Analytics has no idea how long they continued on the website.

In the case of Person B, the “Pageview” fired twice. When they got to the first page it fired, and then 30s later when they navigated to their second page. Since they left that second page without loading another page, Google Analytics only knows that they were on the website for 30s and interacted with two pages.

In the case of Person C, we have a better understanding of their visit. We know they’ve been on the site for at least 30 minutes. The problem here is that the second page, which may be an important page, is tracked as having 0 time on page and a 100% exit rate. This suggests to the analyst that it’s an awful page, and yet we have no idea how long that user was actually on the page.

Most online marketers know this about Analytics and bounce rates. If you’ve got a bounce rate problem and you ask your Analytics guy about it, he’ll say that it’s not necessarily a bad thing, because this segment might be extremely invested in your content, but since they’re getting what they want on that single page, they leave.

Consider a website with a listed phone number–anyone who calls that number has likely gotten what they need out of the website. Then they bounce.

Great, I’ve explained this away. Unfortunately, that’s really not insightful and doesn’t help me understand my traffic. Further, it almost feels like this part of the Analytics experience is broken.

Solving Google Analytics Bounce Rate Issues

Google itself presented a solution to this issue, and this solution has been improved upon since then. Consider lowly me to be simply documenting what an agency might want to know about the issue, namely solving it on a variety of client setups no matter how absurd those setups might appear to everyone else.

The solution is fairly simple. We’re going to fire another interactive event to update Google. We’re going to do this regularly (every 30s) so that we know, within a 30s window, how users are interacting with our site.

I chose 30s because it’s a nice round number, and because Google only records 1 event per session per second and discards the rest. That means that if you fire two events simultaneously (like a goal conversion through an event as well as this heartbeat), one will clobber the other. If you’re going to adjust this value (anywhere you see 30000), I’d suggest adjusting it up.

Also, this doesn’t improve anything except our understanding of user flow. The amount of time users actually spend on the site doesn’t actually change. Google doesn’t bump up your rankings. You won’t make more money. You’ll just be more insightful, and you can tell people that you “just implemented this cool HeartBeat thing,” and be the life of the party.

There are three variations I want to address:

  • Bounce Rate Issues for Classic Analytics
  • Bounce Rate Issues for Universal Analytics
  • Bounce Rate Issues on Google Tag Manager Implementations

NB: None of these solutions work interchangeably.

Also NB: The rest of this article is just step-by-step instructions. So comment and tell me something useful, like what your actual bounce rate and time on site are after a couple of days of having implemented this.

Bounce Rate Issues for Classic Analytics

This is a copy-paste solution, but first let’s ensure you’re actually on Classic Analytics.

  1. Go to a page on your website
  2. Right Click somewhere on the page
  3. Select View Source (Chrome / IE) or View Page Source (Firefox)
  4. Search (CTRL+F for Windows, CMD+F for Macs) for _gaq

If you can’t find _gaq on the page, don’t use this solution, it won’t work.

Otherwise, just add the following code anywhere on your website below the Analytics tracking code.

<script>
setInterval(function() {
 _trackEvent('HeartBeat', '30s', '30s', 0, true);
}, 30000);
</script>

Did you just copy-paste that without knowing how it works or whether you can trust me? Excellent. Don’t spend another moment worrying about it. Alternately, take a look at the Mozilla Developer Network’s JavaScript documentation for the setInterval function, and the Google Analytics documentation for the GA tracker’s Event Tracking functionality.

Also, you really should upgrade to Universal Analytics.

Bounce Rate Issues for Universal Analytics

This, too, is a copy-paste solution, but first let’s ensure you’re actually on Universal Analytics.

  1. Go to a page on your website
  2. Right Click somewhere on the page
  3. Select View Source (Chrome / IE) or View Page Source (Firefox)
  4. Search (CTRL+F for Windows, CMD+F for Macs) for ga(

If you can’t find ga( on the page, don’t use this solution, it won’t work.

Otherwise, just add the following code anywhere on your website below the Analytics tracking code.

<script>
 setInterval(function() {
 ga('send', 'event', 'HeartBeat', '30s');
 }, 30000);
 </script>

Did you just copy-paste that without knowing how it works or whether you can trust me? Excellent. Don’t spend another moment worrying about it. Alternately, take a look at the Mozilla Developer Network’s JavaScript documentation for the setInterval function, and the Google Analytics documentation for the GA Universal tracker’s Event Tracking functionality.

Bounce Rate Issues on Google Tag Manager Implementations

Google Tag Manager (GTM) doesn’t have a copy-paste solution, unfortunately. When you implement your Analytics snippet through GTM it forces you to use a combination of the dataLayer and triggers if you want to fire events the old fashioned way. Luckily, GTM is already very extensible and we can just use its built-in functionality.

If you’ve implemented GA through GTM (acronyms!), it should look something like this:

If you have no idea what’s happening in this screenshot, this tutorial probably isn’t for you. Start here.

Before we get started, some old GTM installs don’t have some useful features enabled. Just click into Variables and make sure your panel looks like mine. Not super relevant, but it’s annoying when this isn’t done.

Now, we need to do two things. One, we need a trigger that fires every 15s. Next, we need an event tag that fires our HeartBeat and attaches to that trigger.

First, the trigger:

  1. Click into your Container.
  2. Click on Triggers in the left navigation.
  3. Click New.
  4. Select Timer.
  5. Set the Interval to 30000.
  6. Set the Limit to 80 (that’s 40 minutes)
  7. Click Continue.
  8. Under Enable When, select url, then matches RegEx, then .*

  1. Click Continue.
  2. Click Create Trigger.
  3. Name it something you’ll remember, like “What the hell does this do7

Now we’ll create the tag that will fire every 30s.

  1. Click on Tags in the left navigation.
  2. Click New.
  3. Select Google Analytics.
  4. Select your flavour of Analytics and click Continue.
  5. Enter your tracking ID or the GTM Tracking ID variable that you’ve created because you’re so pro at GTM.
  6. From the Track Type dropdown, select Event.
  7. Set the Category to “HeartBeat” and Action to “30s” (Ignore the 15s, I changed it!)

  1. Click Continue.
  2. In the Fires On section, we’re assigning the tag to a trigger. Since we created this trigger already, we just need to find it. Click More and select the timer trigger that you created.

  1. Click Save, then Create Tag and name it something catchy like, “TroyFawkes’ HeartBeat Tag Of Awesomeness

It should look like this:

Now just Publish your container.