Latest Asynchronous Google Analytics Code to Tracking Adjusted Bounce Rate

"Bounce rate" in Google Analytics is one of the key metrics that helps to evaluate the quality of your traffic. It is a great indication on how relevant the content was for the user and how engaged they were with your website. "Bounce" happens when the visitor exited the website right from the landing page, […]

"Bounce rate" in Google Analytics is one of the key metrics that helps to evaluate the quality of your traffic. It is a great indication on how relevant the content was for the user and how engaged they were with your website.

"Bounce" happens when the visitor exited the website right from the landing page, without going to any other page.

Google in a blog post, posted a tip to help you track "Adjusted bounce rate" by just implementing a small tweak to Google Analytics code, which executes an event when a user has spent over a certain amount of time on the webpage.

Once the event is executed, the visitor is no longer counted as "bounce," even though no additional pageview is recorded. "This will mean your bounce rate will show users who have not spent a required "minimal time" on your website - the ones who have really bounced," explained Alexey Petrov, Google Analytics Insights Team.

Here is a modification to the Google Analytics code that you need to make (on the example of the latest, asynchronous code):

<script type="text/javascript">var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-XXXXXXX-1"]);_gaq.push(["_trackPageview"]);setTimeout("_gaq.push(['_trackEvent', '15_seconds', 'read'])",15000);(function(){var b=document.createElement("script");b.type="text/javascript";b.async=true;b.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(b,a)})();</script>

The setTimeout function is the one that does the trick here, and you can set it up to whatever delay you wish (in this case, it is 15 seconds).

Moreover, "since the event is created once 15 seconds lapse, you can define this event as a goal in Google Analytics, and even import this goal as a conversion to AdWords, provided the conditions are met," said Petrov.

Depending on the website, "the time can range from 10 seconds to few minutes - you should decide for yourself the amount of time you consider the user to be sufficiently engaged with your website or product," Petrov stated.