app/root.tsx · open source (MIT) · ask in plain English

Add analytics to Remix.

Remix leans on loaders, actions and nested routes, so navigations happen without full reloads and your analytics has to keep up. smolanalytics goes into the head of app/root.tsx as two tags, autocaptures pageviews, clicks, scroll and JS errors across every route, and lets you ask your numbers in plain English instead of building dashboards.

app/root.tsx
// app/root.tsx, inside the <head> of your Root component
<head>
  <Meta />
  <Links />
  <script src="https://YOUR-INSTANCE/sdk.js" />
  <script
    dangerouslySetInnerHTML={{
      __html: `smolanalytics.init("WRITE_KEY", { host: "https://YOUR-INSTANCE" })`,
    }}
  />
</head>

app/root.tsx is the single document shell every Remix route renders inside, so the tags load once and clientside route changes get tracked automatically.

how do I add analytics to remix?

Remix leans on loaders, actions and nested routes, so navigations happen without full reloads and your analytics has to keep up. smolanalytics goes into the head of app/root.tsx as two tags, autocaptures pageviews, clicks, scroll and JS errors across every route, and lets you ask your numbers in plain English instead of building dashboards.

In Remix the interesting signal is the loader-to-action funnel: which routes people land on, which forms they submit, and where actions fail. Autocapture covers pageviews across nested routes plus form submits, clicks with the full element chain, and JS errors. For domain events, call smolanalytics.track("checkout", { total: 49 }) after a successful action and identify(userId) once the session loader resolves the user.

It fits Remix because root.tsx is already the one place your whole app agrees on for the document head, so one install covers server-rendered and client-navigated routes alike. It is a single open-source Go binary, self-host free or hosted from 29 dollars a month, cookieless with no consent banner, and every answer is a deterministic report proven by a CI test not to be made up.

Honest pricing: 14-day full trial, no credit card. Then Solo $29/mo, never metered on seats or sites. Overage is $5/million with an emailed receipt, the dashboard never locks, and self-hosting the single Go binary is free forever (MIT).

Add analytics to Remix tonight.

One snippet, or one endpoint. Tomorrow morning the verdict tells you which part of the funnel to fix.

questions

How do I add analytics to Remix?
Remix leans on loaders, actions and nested routes, so navigations happen without full reloads and your analytics has to keep up. smolanalytics goes into the head of app/root.tsx as two tags, autocaptures pageviews, clicks, scroll and JS errors across every route, and lets you ask your numbers in plain English instead of building dashboards.
Do I need a cookie banner?
Not in cookieless mode. smolanalytics can run without storing anything on the device, so there is no consent banner to add. You still get visitors, referrers, funnels, retention, and paths, and AI-assistant referrals (chatgpt.com, claude.ai, perplexity.ai) show up as their own channel.
Is it enough for a real product, or just page counts?
It does funnels, retention, paths, cohorts, and a daily verdict on what to fix, from the same events, and you ask it in plain English. It deliberately skips session replay, feature flags, and experiments. If you want a straight answer on what to fix, that you own and can self-host free, it fits.

keep reading