Widget

Pageviews & SPAs

The widget records a pageview on the first load and on every subsequent client-side navigation, so single-page apps work with no extra code. What it records is governed by three remote toggles (see Configuration).

Initial pageview

When track_initial_pageview is on (the default), the widget fires a pageview as soon as it loads. Turn it off if you want to control the very first pageview yourself — for example, to wait until a consent choice is made.

SPA navigation

When track_spa_navigation is on (the default), the widget listens for History API navigations (pushState / replaceState and the browser back/forward buttons) and records a new pageview each time the path changes. You do not need to call anything on route change — it is automatic for any framework that uses the History API (React Router, Vue Router, Next.js, etc.).

Only real path changes count as a pageview; replacing state on the same path does not double-count.

URL parameters

When track_url_params is on, the page's query string is kept on the pageview so you can break traffic down by parameter. UTM parameters (utm_source, utm_medium, utm_campaign, utm_content, utm_term) are always parsed into acquisition dimensions regardless of this flag; track_url_params controls whether the full query string is retained for reporting.

Turn it off if your URLs carry sensitive tokens you don't want stored.

Where pageviews show up

Pageviews drive the topline metrics, the Pages report, and every dimension breakdown. Read them back through the analytics API — see Analytics and the Sites overview.