Modifying Google Analytics Code for Improved Tracking of Bounce Rates

 

In addition to receiving and tracking your target web traffic, you also need to track visitors that might just end up at your home page or any other landing page and exit without visiting any other page on your website. This “bounced” traffic can be calculated using the “Bounce Rate” feature in Google Analytics tool.

However, the current Google Analytics code does not factor in visitors that might have stayed on longer on your landing page, extracted vital data from that page and acted positively to contact you through other means such as via a telephone or fax number mentioned on your home page. Another example might be a blog home page that a visitor might read for a longer period of time i.e. for more than 30 seconds or a minute or any other time period, and might exit to search for information provided on your blog.

The above reactions by your target visitors might be positive, but would still rank as “bounced” by Google Analytics. You need to actually find out about visitors that have exited your website page immediately upon landing on it. This is possible by changing the Google Analytics code to incorporate the number of seconds that a visitor spends on your homepage before being classified as a “bounced” statistic.

The basic change in coding is the setTimeout coding that allows you to change the time as per your requirements. For instance, if your home page is too long and requires a lot of reading and scrolling then you can set a longer time period. A little bit of trial and error will help you to finally set a time limit that differentiates between genuinely bounced visitors and those that have merely stayed on longer to actually read the content on your web page.

The revised coding is as follows:

<script type=”text/javascript”>

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-1']);
_gaq.push(['_trackPageview']);
setTimeout(“_gaq.push(['_trackEvent', '30_seconds', 'read'])”,30000);

(function() {
var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
})();

</script>

The setTimeout code mentioned above is at 30 seconds that can be changed as per your specific needs. You can even set that specific time as your “Goal” in Google Analytics as well as import it in your AdWords conversion provided it meets other conditions.

The above modification in code will certainly help you to track your bounce rates much more accurately and further fine-tune your strategy in future. Use different setTimeout values until you find one value that best suits your business model.

Leave a Reply

Your email address will not be published.