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.
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.