Metrics explained

Average session duration and time on page: how each tool measures it

Why GA4, Universal Analytics and privacy tools report different session durations and time on page, the exact method each one uses, and which number to trust.

On this page

"Average session duration" sounds like a stopwatch. It is not. No analytics tool sees a visitor leave; each one infers time from the signals it gets, and the methods differ enough that the same visit can last 0 seconds in one tool and four minutes in another.

This guide explains the three methods in use, what each tool reports, and how to read the numbers.

Three ways to measure time

1. Timestamps between hits. The old method. Time on a page is the time of the next hit minus the time of this one. The last page of a visit has no next hit, so its time is unknown, and a one-page visit lasts zero seconds.

2. Visible time, sent on leave. The browser measures how long the page was in the foreground, and sends it when the visitor switches tabs, hides the app, or leaves. Background time does not count. The last page counts.

3. Heartbeats. The script sends a ping every few seconds while the page is open. The last page gets the time up to the last ping. More requests, and depending on the setup, background time may count.

What each tool reports

ToolSession durationTime on page
Universal Analytics (retired)First hit to last hit; last page counted only if it sent an engagement hitTimestamp difference; last page 0
GA4Average session duration: average length of sessionsAverage engagement time: time in the foreground
PlausibleSum of session lengths over sessions, with one-page visits as 0Engagement events on navigation and tab switch; inactive tabs not counted
MatomoTimestamps by defaultLast page counted only with the heartbeat timer on

Sources for each row: Universal Analytics (Google), GA4 (Google, Google), Plausible (Plausible), Matomo (Matomo).

Universal Analytics, for old reports

Google's definition: session duration is the time from the first hit on the first page to the first hit on the last page, or to the last engagement hit on the last page if there was one (Google). In Google's own example, three pages loaded at 10:00, 10:05 and 10:10 make a 10-minute session, however long the visitor read the third page.

That is why old reports show so many 0:00 visits: every one-page visit without an event lasted zero seconds.

GA4

GA4 has two different time metrics, and they are often confused:

  • Average session duration is the average length of sessions in seconds (Google). It is about the session, not about attention: Google does not say it leaves out time the page sat in a background tab.
  • User engagement is the time your page was in focus or your app in the foreground (Google). GA4 sends it when the visitor leaves the page, hides the tab or closes the app. Average engagement time builds on it.

If you want "how long did people actually look at my site", use engagement time, not session duration.

Why the numbers differ between tools

  • The last page. Timestamp methods give it zero; visible-time methods count it. Blogs, where most visits are one page, see the biggest gap.
  • Background tabs. Engagement time and other visible-time methods leave them out. Timestamp and simple heartbeat methods may not.
  • What a visit is. GA4's session ends after 30 minutes of inactivity. Other tools use a day, or reset at midnight. A longer visit definition makes longer visits.
  • Lost final pings. A phone that kills the browser before it sends the last ping loses that page's time. Every visible-time method undercounts a little.
  • Bots. One-second bot visits pull averages down where they are not filtered. See bot traffic in analytics.

A worked example

Example numbers, made up for illustration. One visitor opens a recipe at 12:00 and reads it for 4 minutes. At 12:04 they open a second recipe, read it for 3 minutes, then switch tabs. The page stays open in the background until 12:40, when they come back and close it.

MethodDuration
Timestamps between hits4 minutes: the last page's time is unknown
A heartbeat that keeps pinging in the backgroundAbout 40 minutes
Visible time7 minutes: 4 plus 3, the background time not counted

All three are "right" by their own rules. Only the third answers "how long did they read".

How to read it

  • Compare a tool with itself. Week to week on one tool is meaningful; one tool against another is not.
  • Look at the distribution. An average hides a crowd of 5-second visits and a few 20-minute ones. A median, or a share of visits over 30 seconds, is steadier.
  • Read it per page. A long time on a pricing page can mean confusion as easily as interest. Pair it with what happened next.
  • Use engagement rate for "did they stay", and time for "how much".

How Sporetag measures time

Sporetag's script measures visible time. It adds up how long each page was in the foreground and sends it when the visitor hides the tab, switches apps or leaves the page, so the last page counts and background time does not. Visit duration is the total of those times over the visit, and a bounce is a visit with one pageview and under 10 seconds of time on the page. A visit in Sporetag is one visitor's day on a site, so its visits are longer, and fewer, than GA4 sessions.

Common questions

How is average session duration calculated in GA4?

Google defines it as the average length of users' sessions, in seconds. A session ends after 30 minutes of inactivity by default. For time people actually spent looking at your pages, use average engagement time instead.

What is the difference between session duration and engagement time?

Session duration is the length of the session. Engagement time counts only the time the page was in focus or the app in the foreground, so it is the better measure of attention.

Why is my average time on page 0 seconds?

Your tool uses timestamps between hits, so the last page of every visit has no end time. One-page visits then last zero seconds. Tools that measure visible time do not have this problem.

What is a good average session duration?

There is no general benchmark worth trusting, because every tool measures it differently. Compare your own pages and periods in one tool.

Does time on page count if the tab is in the background?

In GA4's engagement time, Plausible and Sporetag, no. In tools that use timestamps or simple heartbeats, it can.

Sources

Spotted something wrong or out of date? Email hello@sporetag.com and we will fix it.