Skip to content

Single-page apps

Tidemark listens to history.pushState and popstate, so route changes in most single-page apps are counted as pageviews with no extra code. Navigating to the path you are already on doesn’t send a second pageview.

If your router uses #/path, use the hash variant:

<script defer data-domain="example.com" src="https://stats.example.com/js/script.hash.js"></script>

The fragment is then stored as part of the page path.

If your app updates the URL before the page is ready, use the manual variant and send the pageview yourself:

router.afterEach(() => plausible('pageview'))
© 2026 Tidemark · MIT licenseThese docs set no cookies and run no trackers.