Why is Google Analytics’ “Average Visit Duration” 00:00:00 even though it shouldn’t?

by Jannik on 10/22/2013

This article explains why Google Analytics sometimes shows an “Average Visit Duration” of 00:00:00 even though you are sure the visitors stayed longer. Hint: It’s related to the “Bounce Rate”. We describe a workaround how to track the time even though the visit is seen by Google Analytics as a bounce.

A Sample Scenario

Recently we launched a Google Adwords campaign to advertise a new product for christmas. We built a special landing page for the campaign which should not distract the users thus offering only one interaction option. The only thing people can do on this page is click on a bold button directing them to a mailchimp form to submit their email address so we could get in touch with them.

To track conversion rates and see how people interact with our page we linked Adwords with Google Analytics.

After some days we saw data coming in. It looked weird to us.

Google Analytics Average Visit Duration

People coming to our site visited only one page. Which is fine because that is how we set the campaign up. The “Bounce Rate” is 100% because a bounce is defined as only one page view after leaving the site. What we didn’t understand at first was the “Average Visit Duration” of 00:00:00 … People stayed 0 seconds in our page?! How is that even possible? A phone call with a Google Adwords employee threw light on the situation. It’s actually pretty simple.

Google Analytics works with timestamps instead of something like a real-time counter (technical and privacy related problems). Google Analytics sets a timestamp when a visitor lands on the page and sets a second timestamp when he visits a second page. The difference between those two timestamps is counted as the duration of the visit in the Google Analytics dashboard.

If the visitor leaves the page to another domain or closes the browser window Google Analytics doesn’t set the second timestamp thus records a visit duration of 00:00:00 which should actually be something like “Not defined”.

What happened in our case:

  1. A visitor clicks on an Adwords Ad.
  2. The visitor lands on our site -> The gAnalytics JavaScript code sets a timestamp representing time the visitor landed on the site.
  3. The visitor clicks the call to action button and gets redirected to a mailchimp form (not within our domain).

–> The visit duration is 00:00:00 because the visitor did not go to a second page within our domain (www.socialfunders.org).

Possible Solutions

It is important for us to see how long the visitors stayed on our landing page to be able to react on the visitors behavior. If the visitors stayed only for a couple of seconds our ads might not be relevant or expressive enough. If they stayed longer but didn’t click through to our signup form the copy or images on our page might not be appealing enough.

Track Mailchimp click-throughs

Turns out tracking click-throughs to the mailchimp signup form is pretty easy. You can hook up you mailchimp list with Google Analytics. In the mailchimp backend Go to “Lists” > “YOUR_LIST” > “Settings” > “Google Analytics on archive pages” and enter your Analytics Account ID.

Track Page Exits

To track the duration of a visit even if the user closes the page We use the JavaScript’s onbeforeunload event to track if someone leaves the page without any interaction. We set a dummy page view called “bounce”.

Here’s the code:

// jQuery
$(window).on('beforeunload', function() {
    _gaq.push(['_trackPageview', '/bounce']);
}); 

// Vanilla JavaScript
window.onbeforeunload = function (e) {
  e = e || window.event;
  // For IE and Firefox
  if (e) {
    _gaq.push(['_trackPageview', '/bounce']);
  }
  // For Safari & Chrome
  return _gaq.push(['_trackPageview', '/bounce']);
};

There are 2 comments in this article:

  1. 10/22/2013Why is Google Analytics’ “Average Visit Duration” 00:00:00 even though it shouldn’t? | Code 4 Me University says:

    […] Published: October 22, 2013 Link: http://tech.particulate.me/google-analytics/2013/10/22/google-analytics-average-visit-duration/ Excerpt: “This article explains why Google Analytics sometimes shows an “Average Visit […]

  2. 01/24/2014Online SEO Guide says:

    We explained about Average Visit time duration… Keep Posting ….

Write a comment: