Skip to main content
To add tinyanalytics to a Remix app, add the tracking script to the <head> of app/root.tsx, the document that wraps every route. It loads once for the whole app, and client-side navigation is tracked automatically.

Before you start

  • A tinyanalytics site. If you don’t have one yet, follow the Quickstart.
  • Your site’s numeric site ID, from Settings → Tracking in your dashboard.

Add the script to app/root.tsx

Place the tag in the <head>, alongside <Meta /> and <Links />:
app/root.tsx
Replace YOUR_SITE_ID with your real site ID. If you’ve toggled options in Settings → Tracking, add each one as another data-* attribute on the <script>.

Client-side navigation is tracked automatically

Remix renders route changes on the client, and tinyanalytics records each one as a new pageview by default (data-track-spa). You don’t need to hook into the router. See Track single-page apps to change this.

Verify

Run or deploy your app, open it in a browser, then check Realtime in your dashboard for your visit. See Verify your setup for the full check.
Your install is working when your own visit appears in Realtime in your dashboard.

Install on React

A plain React or Vite app instead.

Configure the tracking script

Every data-* option you can set.

Track custom events

Send events from your components.

Verify your setup

Confirm tracking works.