Pageviews
A pageview is recorded every time a visitor loads or navigates to a page on your site.
What triggers a pageview
Section titled “What triggers a pageview”A pageview is recorded when:
- A page is loaded (initial load or full navigation)
- The tracker’s
pageviewevent is fired manually (e.g. in a single-page app using a non-history router)
The default tracker (tracker.js) automatically fires a pageview on every page load, and also hooks into the browser History API so client-side route changes in single-page apps are tracked automatically (see below).
Single-page applications (SPAs)
Section titled “Single-page applications (SPAs)”The tracker hooks into the browser History API (pushState, replaceState, and popstate), so client-side route changes in SPAs are tracked automatically — no manual calls needed. This works with React Router, Vue Router, Angular, SvelteKit, and other history-based routers.
You only need to fire pageview manually if your app navigates in a way that doesn’t touch the History API (rare), for example a hash-based router:
// Only needed for non-history routers (e.g. hash routers)window.metrixs('pageview')What is NOT counted as a pageview
Section titled “What is NOT counted as a pageview”- Bot traffic (automatically filtered — see Bot detection)
- Visitors who have set
localStorage.setItem('metrixs_ignore', 'true')in their browser (self-exclusion) - Requests from
localhostor127.0.0.1(unlessdata-local-devis set on the script tag) - Headless browsers and automation tools (Puppeteer, Playwright, Cypress, etc.)