Docs
Navegar pela documentação

Add Privatus Analytics to Remix

Add cookieless analytics to Remix or React Router 7 framework mode in app/root.tsx, with client navigations tracked automatically.

Ver como Markdown

Add the snippet to the <head> in app/root.tsx:

tsx
import { Links, Meta, Outlet, Scripts, ScrollRestoration } from '@remix-run/react'

export default function App() {
  return (
    <html lang="en">
      <head>
        <Meta />
        <Links />
        <script defer src="https://privatusstats.com/js/pa.js" data-site="pa_YOURSITEID" data-modules="engage,auto,vitals,clicks,ask" />
      </head>
      <body>
        <Outlet />
        <ScrollRestoration />
        <Scripts />
      </body>
    </html>
  )
}

Client navigations use history.pushState, which the tracker follows automatically.