The Ruby on Rails and ClojureScript experts

Jul 8, 2013

This Google article explains how to measure Bounce Rate more accurately by adding an event that gets fired after, e.g., 15 seconds on page. Any visit during which this event gets fired is not considered a bounce. No additional setup required.

Here is the code (setTimeout):

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

Link: Tracking Adjusted Bounce Rate In Google Analytics – Analytics Blog via