Clarvivo
DocumentationTrack your site

Tracking

Install tracking once, then let it follow the journey

The browser tracker records pageviews, sessions, visitor context, and client-side navigation. Add it to the layout shared by every public page, not to a single campaign page.

Add the browser script

Copy the project-specific snippet from Dashboard → Integrations → Tracking Script. Put it before the closing </head> tag in your shared layout or HTML template.

<script defer data-cfasync="false" src="https://app.clarvivo.com/js/YOUR_PROJECT_KEY/analytics.js"></script>

Replace YOUR_PROJECT_KEY with the key from your project. The key is intentionally public because it has to load in visitors’ browsers.

Framework placement

  • Next.js App Router: render the script in the root layout body with next/script.
  • Vite, CRA, Astro, or static HTML: put it in the shared index.html, layout, or head template.
  • Nuxt, SvelteKit, Remix, Gatsby, and other frameworks: put it in the root document or framework-level head configuration.

For framework-specific code, use the MCP or open the tracking setup panel in Integrations.

Single-page applications

No router hook is needed. The tracker observes history.pushState, history.replaceState, and popstate, so ordinary client-side navigation becomes a pageview automatically.

Keep tracking inside the right boundary

In Integrations, configure the domains and paths that belong to the project. Allowed hosts include subdomains; included paths use prefix matching; excluded paths win. Use exclusions for places such as internal tools or account pages.

When a visit is outside the configured boundary, Clarvivo quietly excludes it rather than recording it under the wrong project. You can also turn automatic SPA route tracking on or off there.