Ever wondered how Google Analytics knows when you leave a page? It turns out, it doesn’t, which makes “Avg. Time on Page” and “Avg. Session Duration” interesting metrics.
Our goal at Envato Tuts+ is to help people learn. If someone spends fewer than thirty seconds on a tutorial, they could have saved it to read later, but in most cases we can assume that they haven’t learned from it.
Google Analytics’ “Segments” let you filter any graph or table to show just visitors with a certain characteristic, like those viewing the site on a tablet or those that have visited the site before. So, why not use these to examine how many people spent more than thirty seconds reading tutorials?
The answer is: because “Avg. Time on Page” doesn’t work like that. Neither does “Avg. Session Duration”, for that matter.
Let’s suppose I go to the Envato Tuts+ home page, spend ten seconds scrolling through the front page, click a tutorial that I like, spend fifteen minutes reading it, and then close the tab. The “Avg. Time on Page” that GA records for the front page is ten seconds. The “Avg. Time on Page” that GA records for the tutorial is... zero seconds.
Yes, Zero Sec— Wait, What?
You see, the only way GA can calculate how long you’ve spent on a page is by taking:
- The time you loaded the page (which it knows), and
- The last time you did anything on that page
...and figuring out the difference between the first and the second.
Google Analytics can detect when you click a link and log the time, but it can’t detect when you close a tab—that’s why Google Analytics knew how long I spent on the front page, but not on the actual tutorial. If I clicked a link to a related Quick Tip when I finished reading the tutorial, read the Quick Tip, and then closed the tab, then Google Analytics would record a “Avg. Time on Page” of 15 minutes for the tutorial, and (again) zero seconds for the Quick Tip.
Getting Around This
Remember in When a Bounce is Not a Bounce, I said you could send Google Analytics a signal that says, “this isn’t a bounce”? Well, those signals also let GA know that the reader is still there—they give it a better estimate of the time the reader last did anything on the page.
We can also send signals that don’t mess around with the bounce rate, but that GA can still use to form this estimate. They might simply say, “the reader is still here”, or they may serve some other purpose as well.
We could fire off one of these signals every thirty seconds, so we’d know how long each reader spent on each page with an accuracy of half a minute. This can be misleading, though, since a tutorial that sits in a background tab for half an hour and then gets closed without being read would record an “Avg. Time on Page” of thirty minutes.
My personal preference would be to pair this with another measure of engagement: for instance, send a signal for every 100px the reader scrolls down the page, or every minute of video they watch on an embedded screencast. This would still overestimate “Avg. Time on Page” for tabs left open in the background (assuming they were eventually read or watched), but we’d be able to gather more interesting information; do readers skim or scrub through the content, or read it properly? Do readers bail out half way through, or stay till the end?
Next time, I’ll talk about why “pageviews”, a commonly used metric, isn’t an all-important measure of how a website is performing.
Envato Tuts+ tutorials are translated into other languages by our community members—you can be involved too!Translate this post