DocsMeasure
Single-page apps
Route changes count as pageviews, with nothing to set up.
Automatic
The script listens for the browser’s history changes (pushState, replaceState, back and forward), so routers in React, Next.js, Vue, Svelte, Astro and others count each new route as a pageview. A change that keeps the same path, like a new query string, doesn’t count twice. A page restored from the back-forward cache counts as a new view.
Hash routes
If your app routes after # (/#/settings), add data-hash to the script tag. Each hash route is then its own page.
<script defer src="https://dominion-8yr.pages.dev/d.min.js" data-site="YOUR-SITE-ID" data-hash></script>Counting by hand
For full control, add data-manual and count views yourself. The url is a path on your site.
<script defer src="https://dominion-8yr.pages.dev/d.min.js" data-site="YOUR-SITE-ID" data-manual></script>dominion('pageview')
dominion('pageview', { url: '/checkout/step-2' })