To add Obsidesk to Remix or React Router framework mode, put the script tag in app/root.tsx. It records page views as routes change, detects form signups and shows revenue by channel once a revenue source is connected.
What you get
- Page views for every route, including client navigation
- Signups from forms
- Custom events
- Revenue by channel
- Cookieless tracking
Set it up
- 1Create your account and add your domain
Sign up, add the domain you want to track and copy your site ID from Settings. Every plan has a 14-day money-back guarantee; there is no free trial.
- 2Add the script in root.tsx
Put it in
<head>of your root layout.export function Layout({ children }: { children: React.ReactNode }) { return ( <html lang="en"> <head> <Meta /> <Links /> <script defer src="https://obsidesk.com/script.js" data-site="YOUR_SITE_ID" /> </head> <body> {children} <Scripts /> </body> </html> ); } - 3Deploy and verify
Open your site in a normal browser window and check that the visit appears in the live view. Visits on localhost are not counted unless you add
data-allow-localhost, and your own visits can be excluded by opening#obsidesk-ignoreonce. - 4Pass the visitor ID in your action
If you create Stripe Checkout in an action, include the browser's visitor ID in the form and set it as
client_reference_id.
Server and client
The script runs in the browser. Loaders, actions and server rendering are unaffected.
Revenue
Connect Stripe or Paddle under Settings, then Revenue. Attribution is first-touch, as explained in the guide.
FAQ
How do I add analytics to a Remix app?
Add the Obsidesk script to the <head> in app/root.tsx with your site ID.
Does it work with React Router v7 framework mode?
Yes, the same root layout approach applies.
Do I need a package?
No. The script tag works. @obsidesk/analytics is also available as a package.
Works with
Connect Remix and React Router in about a minute.
14-day money-back guarantee. Installed in 30 seconds. Read-only revenue connections.