Skip to content

React Router and Remix

Terminal window
npx @plaintrace/cli init --site <site id> --endpoint https://collect.plaintrace.dev

The CLI adds the script to app/root.*. By hand, put it in the <head> of your root layout:

app/root.tsx
<head>
<Meta />
<Links />
<script async src="https://collect.plaintrace.dev/t.js" data-site="<site id>" />
</head>

Client-side navigations are recorded as soft page views automatically.

For events, use @plaintrace/browser or window.px once the script has loaded. The server SDK runs in your server entry or adapter, before the request reaches the app.