How are the traffic metrics calculated (visits, page views, unique visitors, time spent, bounce, clicks)?
Short answer
Traffic metrics fall into three families:
- counters (visits, page views, time spent, visits to one page, clicks): they add up from one day to the next;
- unique visitors: they do not add up freely, because the same visitor can come back several times in the period;
- ratios (page views/visit, bounce rate, time spent/visit…): they are never added up or averaged, they are recalculated from the counters.
This page gives the calculation rule of each metric, its key in the reporting API (the field of the metrics), and what changes from one report to another.
The session
A visit is a session: it starts with the first page view and ends after 30 minutes without a new page view. Any page view after those 30 minutes opens a new visit.
Counters
| Metric | API key | Calculation |
|---|---|---|
| Visits | visit | Number of sessions. In a page report, a visit is counted once for each page viewed during the session (see below). |
| Page views | hit | One page view for each call of the collection tag, including when the user comes back to a page already viewed. |
| Reloads | hitreload | Pages reloaded by the user. |
| Visits to one page | visitone | Visits that viewed a single page. |
| Time spent | duration | Cumulative time of the visits, in seconds in the export. |
| Inbound visits | visitin | Page reports: visits that start on the page. |
| Outbound visits | visitout | Page reports: visits that end on the page. |
Unique visitors
| Metric | API key | Calculation |
|---|---|---|
| Monthly unique visitors | visitor | A visitor is counted on the day of their first visit of the calendar month, then not again until the end of the month. |
| Daily unique visitors | dvisitor | A visitor is counted once on each day they visit the site. |
| New UV | newvisitor | Unique visitors seen for the first time. |
What this means for an export:
- Over a full calendar month,
visitorgives the month’s number of unique visitors. Adding up that month’s day-by-day values gives the same total. - Over part of a month,
visitoronly counts the visitors whose first visit of the month falls in the period. A visitor who came on the 3rd and came back on the 20th is not counted over the period from the 15th to the 31st. - Over several months,
visitoris the sum of each month’s unique visitors: a visitor present in October and in November is counted twice. - On the 1st of the month,
visitoranddvisitorare equal, since every visitor that day is on their first visit of the month. On the following days,visitorbecomes smaller thandvisitor. - Over several days,
dvisitoris the sum of each day’s unique visitors: a visitor who came on three different days is counted three times.
Example: a user visits the site on 3 October, 20 October and 2 November.
| Day | visitor | dvisitor |
|---|---|---|
| 3 October | 1 | 1 |
| 20 October | 0 | 1 |
| 2 November | 1 | 1 |
| Total from 1 October to 30 November | 2 | 3 |
Ratios
Ratios are calculated from the counters of the whole requested period, not day by day. To reproduce them over several days or several rows, add up the counters and then divide; never average the exported ratios.
| Metric | API key | Calculation |
|---|---|---|
| Page views/visit | hit_visit | page views ÷ visits |
| Time spent/visit | duration_visit | time spent ÷ visits |
| Time spent/page view | duration_hit | time spent ÷ page views (page reports) |
| Bounce rate | visitone_visit | visits to one page ÷ visits |
| Inbound bounce rate | visitone_visitin | visits to one page ÷ inbound visits (page reports) |
| Exit rate | visitout_visit | outbound visits ÷ visits (page reports) |
| Reload rate | hitreload_hit | reloads ÷ page views |
| Visits/unique visitor | visit_visitor | visits ÷ monthly unique visitors |
| New UV/UV | newvisitor_visitor | new UV ÷ monthly unique visitors |
Time spent/visit divides by all visits, visits to one page included.
Example: over two days, 100 visits of which 40 to one page, then 300 visits of which 60 to one page. The bounce rate of the period is (40 + 60) ÷ (100 + 300) = 25%, not the average of 40% and 20%, which would give 30%.
Clicks
| Metric | API key | Calculation |
|---|---|---|
| Inbound clicks | click | Clicks that bring the user to the site. |
| Session inbound clicks | clicksession | Arrival clicks deduplicated on the same link over 30 minutes. |
| Unique inbound clicks | clickunique | Arrival clicks counted per unique visitor. |
| Impressions | view | Advertising impressions collected. |
| Clicks/impressions | click_view | inbound clicks ÷ impressions |
| Outbound clicks | clickout | Clicks that take the user off the site, if the “outbound traffic” option is enabled. |
Inbound clicks are read by channel, in the Global Summary or Landing pages by channel. The All my traffic report, which gives the site’s totals, only offers outbound clicks.
What changes from one report to another
The kind of an API request reproduces a report of the interface, with its counting rules. A report’s exact kind can be read in the ea-datasource value of the request the interface sends (see the 13 recommendations for the reporting API).
| Report | kind | What a row counts |
|---|---|---|
| All my traffic | rt#website | The site’s totals: one visit = one session. |
| Global Summary | rt#insummary | Traffic by channel: one visit = one session. |
| Traffic by page reports | rt#pagetree | A page: the visit is counted once per session for each page viewed, even if the page is viewed several times. |
| Landing pages by channel | rt#landing | A channel’s landing page: visits and page views as in traffic by page, plus inbound visits. |
In page reports:
- the sum of the visits of all pages is greater than the site’s number of visits, since a visit to five different pages counts five times;
- the sum of the inbound visits of all pages matches the site’s visits, since each visit has only one entry page;
- a page’s visits to one page are the visits that started and ended on that page. The bounce rate divides by all the visits that viewed the page; to judge a page as an entry point, the inbound bounce rate says more.
The detail, with an example journey, is in Why does my number of visits change from one report to another?.
Key points for an export
- Add up the counters (
visit,hit,duration,visitone,click…), then recalculate the ratios. - Do not add up the unique visitors of several months or several days expecting distinct people: request the period you want directly.
- Do not add up the visits of page reports to get the site’s visits: use All my traffic, or the sum of inbound visits.
- Convert
durationandduration_visitfrom seconds. - Run the previous day’s exports from 6 am, once the previous day’s data is complete.
All metrics and their post-click, post-impression and revisit variants are listed in the metrics glossary.