Documentation
SPA Support
Automatic tracking for single-page applications.
How it works
Measure automatically detects client-side navigation. When
your app uses history.pushState
or the user navigates with the browser's back/forward buttons,
we count it as a new pageview.
No additional configuration is needed. The same script tag you added during installation handles everything.
What we listen for
The Measure script monitors two browser APIs to detect navigation:
history.pushState
Called by frameworks like React Router, Vue Router, and SvelteKit when navigating between routes. Measure intercepts this call and sends a pageview for the new path.
popstate event
Fires when the user clicks the browser's back or forward buttons. Measure listens for this event and records the new page.
Framework compatibility
Because Measure hooks into standard browser APIs, it works with any framework that uses client-side routing:
Next steps
Continue exploring the documentation.
- UTM Parameters — track marketing campaigns automatically
- Data Collection — exactly what we collect and what we don't
- AI Agent Analytics — detect traffic from AI agents