Time On Page vs Session Duration: Tricky Metrics Demystified

Time On Page vs Session Duration: Tricky Metrics Demystified

Do you look at Average Time on Page and Average Session Duration while evaluating the performance of your site?

Well, these might not be the best metrics to rely on (especially if you’re not aware of how Google Analytics, and Google Analytics Premium for that matter, calculate them).

Let me help you be more aware of how Google Analytics calculates time and duration.

Time on page

This is one of the basic metrics in Google Analytics. You might be using it as an indicator, assuming that “the longer, the better”. Wrong.

This is because:

1) The assumption is wrong

Is staying 10 minutes on one page equal to 10 minutes of engagement? Not really. Of course, sometimes if your user stays longer on a single page, it might mean he was having an amazing time consuming your content. But it may also be he got lost and spent that time trying to figure the way out because the site navigation was terrible.

It’s just not the best metric to evaluate user engagement (if used without context and / or accompanying metrics).

2) The calculation is a little bit skewed

You may ask: “What could be easier than calculating such a simple metric as time on page?”. Well in fact – it’s not all that simple.

Firstly, you have to know how Google Analytics works. When any interaction on a site occurs (pageview, interaction event or transaction) a hit is sent to the tool. Each hit carries a timestamp i.e. exact date, hour, minute and second when the interaction happened. So we have timestamps for every hit reported by Google Analytics.

A session might look like this:

how google analytics calculates time on page metric
Time on page, despite its seeming simplicity, is not that easy to calculate.

How much time did the user spend on page A?

30 seconds? Correct!

How much time did the user spend on page B?

30 seconds? Correct

How much time did the user spend on page C?

30 seconds? Wrong. Google Analytics shows you 0 seconds on that very last page.

Google Analytics subtracts timestamps: time page B – page A. So for page A Time on Page equals 00:30. For B also 00:30. Easy peasy.

But now here’s the hard part. If Google Analytics subtracts timestamps what will be the Time on page C, when the user left the webiste? There is no timestamp on the next page (as the user went to another website, or just closed the browser), so there is no reference to count the time.

The result time on page C equals 0. But this is not true. The user could have spent 30 seconds there or even 3 minutes and then left. No difference: there were no following hit, so there is no way to calculate the time – it’s always 0.

So, we have these calculations:

A – 0:30
B – 0:30
C – 0:00

And what if it were a single-page session?

how google analytics calculates time on page metric singe-page session
If we take a singe-page session, the calculation is a bit skewed.

If there are no events or virtual pageviews, Google Analytics will count that visit as a bounce. So a bounce rate of 100%. What about time on page? It’s 0 – in the same way: there was an exit, so the tool can’t compute time.

As you see, the way Google Analytics calculates Time on Page is a little bit skewed.

And the real time on a page can also be warped by a midnight break. At 00:00 hour, every session is broken, and a new one starts.

So how is the Average Time on Page metric calculated?

Time on Page / (Pageviews – Exits)

This means that this metric is not that bad if you have a very low % of Exits for a certain page. But if not: you should be very wary when using it.

Session Duration

The same rule works for session duration. Let’s get back to our example:

how google analytics calculates average session duration
Session duration should be calculated just like the Time on Page metric.

To get Session Duration we have to add times on particular pages (or subtract the first timestamp from the last one):

00:30 + 00:30 + 00:00 (remember, it’s 0 because Google Analytics is not able to count the time).

This means that the session lasted for 1 minute in Google Analytics. In reality, it could’ve been even 29 minutes, if the user spent 28 minutes on page C. But the tool just doesn’t know that.

What is the session duration for a single-page visit?

The session is 0 seconds, because there was no additional hit with a timestamp.

Ok, but let’s dig deeper.

What if a user explores your page using tabs (everyone does it, right?).

The user came to your website and started his visit with page A at 11:00:00. Then at 11:01:00 he opened the next tab with page B, spent 15 seconds there and opened a new tab with page C at 11:01:15. Then after 15 seconds he closed the tab with page C, came back to page A and after 15 seconds followed a link to page D (at 11:01:45) in the same tab. Then after 30 seconds, he left the tab with page D open, got back to an active tab with page A, spent 15 seconds there, followed a link to page E and closed the browser altogether.

So in reality the user spent 2 minutes 35 seconds visiting your website. He spent 1 minute 30 seconds on page A, 15 seconds on page B, 15 seconds on page C, 30 seconds on page D and 5 seconds on Page E.

How would Google Analytics count the time on page and session duration for such a visit?

As mentioned above it’s pretty straightforward to calculate session duration. Pick out the timestamps of the first and the last hit the tool received during the session. These are opening page A at 11:00:00 and opening page E at 11:02:30. This simple calculation tells us that the session lasted for 2 minutes and 30 seconds (5 seconds less than in reality). Bravo!

But what does the time on page look like for every single page? Well, it looks like this and it doesn’t have much to do with the reality:

(A) 01:00
(B) 00:15
(C) 00:30
(D) 00:45
(E) 00:00

It doesn’t have to do much with the reality does it? Still it adds up to the total of 02:30:00.

Now you know that these two metrics are a little bit flawed and you have to remember about their flaws when using them.

And now we will dig into one more detail.

Have you ever notice that the Avg. Time on Page is higher than the Avg. Session Duration. How the hell is that even possible?

average time on page higher than average session duration
How is it possible that Avg. Time on Page is higher than the Avg. Session Duration?

You must remember that Time on Page is a “page level” metric while Session Duration is a “session level” metric. So if you are analyzing Avg. Session Duration for a particular page on your website, you get the answer to the question “How much time did a users spend on my website when the visits started from page X?”. That’s worth remembering (and please read this post by Avinash Kaushik where he goes more into the details about page and session level metrics).

So, should I forget and never use average time on site and average session duration again?

Frankly speaking these two metrics are quite poor when it comes to assessing user engagement. I would recommend focusing on more reliable engagement metrics. Use event tracking for scrolling, clickmaps and micro-conversion tracking (like PDF downloads or newsletter subscription). Look how deeply users go into your page. Ask them whether they have managed to fulfill their aim or reach their goal.

But of course, don’t get rid of them! Just use them along with the other metrics mentioned above and track the themes in longer time periods so you know how they have changed over time.

Another solution is to use a hack that will get you more accurate data concerning time on page and session duration. Read this great post by Yehoshua Cohen and Simo Ahava – it presents advanced technical solutions to count real time in Google Analytics (even better – the real time page is visible!). It’s great, but more for techies.

I hope I have helped you understand the intricacies of time calculation for Avg. Time on Page and Avg. Session Duration in Google Analytics. If you still need these metrics for your analyses – at least you now know how they are skewed. And you can still use them, in full awareness of any possible distortions.

By the way, if you’re looking for some help in terms of digital analytics, contact us today and learn our unique approach. We will do everything in our power to meet your expectations.


Author: Paweł Ogonowski

have been transforming our clients companies into data-driven organizations for over 5 years. I strongly believe that the key to success is a structured process to analytics and conversion rate optimization. I am a frequent speaker at industry conferences and an author of 80+ articles on CRO and DA.

Follow me on Twitter @Pajex


Grow Your Conversion Rate

Get your free copy of Ultimate Conversion Rate Optimization Toolkit:

Get Yout Free Copy Now
Read previous post:
How Your Digital Marketing Department Can Become Independent of IT

Time is money. Especially in the case of online businesses where - when it comes to delivering the best results...