> ## Documentation Index
> Fetch the complete documentation index at: https://tinyanalytics.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Remix Analytics Integration

> Add tinyanalytics to app/root.tsx so the tracking script loads on every Remix route and records client-side navigation automatically.

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](/docs/tinyanalytics-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 />`:

```tsx app/root.tsx theme={null}
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://dash.tinyanalytics.io/script.js"
          data-site-id="YOUR_SITE_ID"
        />
      </head>
      <body>
        <Outlet />
        <ScrollRestoration />
        <Scripts />
      </body>
    </html>
  );
}
```

<Tip>
  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>`.
</Tip>

## 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](/docs/configure-tinyanalytics-tracking-script#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](/docs/verify-tinyanalytics-installation) for the full check.

<Check>
  Your install is working when your own visit appears in **Realtime** in your dashboard.
</Check>

## Related

<Columns cols={2}>
  <Card title="Install on React" icon="react" href="/docs/integrations/react-analytics">
    A plain React or Vite app instead.
  </Card>

  <Card title="Configure the tracking script" icon="sliders" href="/docs/configure-tinyanalytics-tracking-script">
    Every `data-*` option you can set.
  </Card>

  <Card title="Track custom events" icon="hand-pointer" href="/docs/custom-event-tracking">
    Send events from your components.
  </Card>

  <Card title="Verify your setup" icon="circle-check" href="/docs/verify-tinyanalytics-installation">
    Confirm tracking works.
  </Card>
</Columns>


## Related topics

- [Angular Analytics Integration](/docs/integrations/angular-analytics.md)
- [Gatsby Analytics Integration](/docs/integrations/gatsby-analytics.md)
- [Astro Analytics Integration](/docs/integrations/astro-analytics.md)
