Install on React Router

Choose the document that actually loads your application. Copy the token from Seean → Settings → Installation and respect your site’s analytics-consent flow.

React with Vite

For a client-rendered React application using BrowserRouter or RouterProvider, open the project-root index.html. Put this before </head>:

<script defer src="https://app.seean.io/k.js"
  data-site="YOUR_SITE_TOKEN"
  data-api="https://app.seean.io"></script>

Replace the token. Keep the existing application entry script. Do not put the tracker inside every route component or inject it from an effect that runs on every navigation.

React Router Framework Mode

In Framework Mode, app/root.tsx owns the HTML document. Add the following inside the existing <head> alongside your metadata and links:

<script
  defer
  src="https://app.seean.io/k.js"
  data-site="YOUR_SITE_TOKEN"
  data-api="https://app.seean.io"
/>

Preserve the existing Meta, Links, Outlet, ScrollRestoration and Scripts components your root uses. This also applies when Framework Mode builds a prerendered entry document with ssr: false; edit the source root, not generated build output. Root document, SPA Mode.

History and hash routers

Seean measures pathname changes through the browser History API. /pricing and /contact can produce separate pageviews. /#/pricing and /#/contact both have pathname /; with HashRouter, add data-hash="true" to the script tag so each hash route is reported as its own page (script options). A UI change that leaves the URL pathname unchanged needs an explicitly named custom event if you want to measure it.

Do not add a route-change track("pageview") handler alongside automatic tracking. Repeated installation can count one navigation more than once.

Publish and verify

Build and deploy with your existing hosting setup. Follow installation verification on the published site, including a client-side link and Back/Forward. Also open a nested route directly. If that URL returns the host’s 404, fix the hosting/router fallback; adding another tracker does not fix routing.

For localhost or 127.0.0.1, add data-local to the tag and use a separate test token. Privacy preferences and browser automation can still prevent collection. To remove Seean, remove the tag from its source document and redeploy. Existing data remains.

Something unclear? Contact support.