How is Session Duration Calculated in Google Analytics?

Session duration in Google Analytics, or the average time on page, is one of the most common metrics used by people and companies to determine the ‘performance’ and quality of traffic being driven to their site.

The average session duration allows us to work out what acquisition sources are most effective and is widely regarded as a benchmark KPI to determine whether traffic quality is good or bad. Well why not right? If someone stays on your site for a long time then that’s an ‘engaged’ user. And who doesn’t want traffic that is engaged and stays on your site?

In the digital agency and client arena, session duration is often a talking point as to whether various campaigns are working or not. Often these are compared with ambitious industry benchmarks or specific targets.

Although session duration may certainly not have the definitive properties of conversion or revenue data, in most cases, it is a metric that is considered to be directly proportional to campaign performance.

The Truth About Session Duration

Now here is the funny thing; most advertisers, webmasters and even agencies have no clue what the session time metric actually means and more importantly, how it is calculated.

If I was to ask one of my clients (I would also put a little wager on the same response coming from an agency counterpart!) right now what they thought session time was the answer would be something along the lines of: “session duration is the length of time someone spends on my website”.

Well of course it is!… it’s called ‘session duration’! What else could it possibly be?

The problem with that response is that is is both right and wrong.

Let me explain. If you look at the definition of the average session duration in Google Analytics it goes like this:

Average session duration is: total duration of all sessions (in seconds) / number of sessions.

Sounds pretty straight forward right?

In order to really understand the metrics we need to dig a little deeper into the specifics on how session duration is calculated which will drastically affect your understanding of your traffic.

The Catch with Session Time Calculation

The problem with how we may think session duration works is that Google Analytics cannot actually work out exactly when we stopped interacting with the website.

That means that if we have a standard setup where we are simply tracking page views (this is the default), Google Analytics will only record session duration based on the time of your last page entrance, or as Google defines it as, the last interaction.

See this little illustration:

Google Analytics session duration calculation


Have a quick look at the above example. This means if you were to visit 3 webpages on a website, downloaded a PDF after 10 minutes on your third webpage and then left the site 10 minutes later, your session time actually stops at 6:15. Everything after that final page entrance has effectively been overlooked because Analytics has no way to measure what time you downloaded your PDF or what time you exited the website.

This doesn’t really sound too accurate does it?

Let’s put this into a real life example. Let’s say last Friday after work you went out for dinner and a few drinks. Your better half then asks you “how long did you stay out for?” The way you would calculate this is quite simple: Considering you went to grab a bite at 6pm which took an hour. Then from there you went to your favourite local pub at 7:30pm and stayed for a little while, enjoying a game that happened to be on the big screen at the time. Then you left at around 10pm. You would naturally calculate the above as 4 hours since you left at 10pm (6pm – 10pm).

Now if time was recorded in the wild world of Google Analytics, then the situation would be much different (and your significant other a lot happier!).

You see Analytics would only be able to record your entrances to the venues! This means that in the above example your ‘session duration’ would have been 1.5hrs! Google Analytics does not know when you actually left the pub.. it can only record when you got in. Check out the diagram below to help visualise it:

real life google analytics


Now you understand how Analytics actually records your session time, you will probably look at the traffic a little differently. Think about the following scenarios:

– What if your most important page takes 20minutes to read and the reader usually leaves afterwards?
– What if a good user experience is actually downloads?
– What if your key content is a video?

The good news is that since session time is based on your last interaction, we can look at tracking more interactions which in turn, will give us better and more accurate data. And guess what? A user interaction doesn’t necessarily need to be a ‘pageview’, it can also be an event!

That means if you track your key site interactions, (downloads, link clicks, video views etc) which will be recorded as part of your session duration calculation.

Now lets go and revisit the example we looked at previously:

Session duration after event tracking in Google Analytics

Can you see the difference here? Now the session duration comes in at 30 minutes because the event of someone downloading the PDF is being tracked and is factored into the session duration.

That means if someone was to visit a page, read that page and then download a brochure or a .pdf and then left, the session duration will only stop recording from the final interaction that user makes. This allows for more effective and accountable session duration data that you and your clients can reply on.

Even though we still don’t know when the user left the website, the duration is much more accurate compared to what we saw in the previous example where only page visits were regarded as interactions.

Let’s take the pub example we mentioned above. If your programmed Google Analytics to track not only the venue entrances but programmed it so that each meal and each drink you had within the venue was recorded as an interaction, then your session time would record up until you finished your last drink. This would take your session duration closer to the 4hrs it actually took.

This version of Analytics will give you much greater insight to the drinking problem you may have, compared to the teetotalling zend living feedback it gave us in the first instance.