Skip to main content
The pixel fires one pageview when the document loads. In a single-page app, navigations don’t reload the document — so you fire a pageview yourself on each route change. Everything else (the vid, identify, revenue attribution) works unchanged.

1. Load the pixel once

Add the script to your app shell so it loads on first paint:

2. Fire a pageview on each route change

Use optional chaining (window.trk?.pageview()) so a route change never throws if the script hasn’t finished loading yet.

3. Identify and track as usual

These don’t depend on route changes — call them whenever the event happens:

4. Pass the vid at checkout

If checkout runs client-side, read window.trk.vid when you create the session; if it runs server-side, read the vid cookie. See Pass the visitor id to checkout.
Your SPA now records a pageview per navigation, and the visitor journey shows the full in-app path — not just the landing page.