# Time on page

Also called: visit duration, session duration, engagement time, dwell time

Time on page is how long a visitor spends on a page. Visit duration is the same idea for a whole session. Both estimate attention, and both depend heavily on how the tool measures them.

## How it is calculated

The older method subtracts timestamps: the time between one pageview and the next. It cannot measure the last page of a visit, because nothing follows it, so single-page visits count as zero seconds.

The newer method measures directly. The script tracks how long the page is visible and reports that total when the page is hidden or left. Time in a background tab is not counted, and the last page of a visit is measured like any other.

```
average visit duration = total visible time ÷ sessions
```

## Example

A reader opens an article, reads for four minutes, switches to another tab for twenty minutes, returns for one minute and closes it. Timestamp subtraction would record zero, because there was no second pageview. Visible-time measurement records five minutes.

## Common mistakes

- Comparing durations between a tool that subtracts timestamps and one that measures visible time. The second is usually higher on content sites and more accurate.
- Using the average alone. A few very long visits pull it up. Look at it per page and per source.
- Assuming longer is better. On a checkout or a docs answer, a short time can mean the page worked.

## How CrispStats shows it

CrispStats measures time as seconds the page was actually visible. The script sends the running total when the page is hidden or left, and before each single-page navigation, so the last page of a visit is counted and background tabs are not. Average visit duration is on the overview and in every breakdown.

## Related terms

- [Engagement rate](/glossary/engagement-rate)
- [Bounce rate](/glossary/bounce-rate)
- [Scroll depth](/glossary/scroll-depth)
- [Session](/glossary/session)
