> ## 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.

# Nuxt Analytics Integration

> Declare tinyanalytics in nuxt.config so every page loads the script and Nuxt client-side route changes are tracked automatically.

To add tinyanalytics to a **Nuxt** app, declare the tracking script in `nuxt.config` so Nuxt injects it into the `<head>` of every page. Route changes are tracked automatically, so you don't need to touch the router.

## 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 in `nuxt.config`

Add the script to the `app.head.script` array in `nuxt.config.ts`:

```ts nuxt.config.ts theme={null}
export default defineNuxtConfig({
  app: {
    head: {
      script: [
        {
          src: "https://dash.tinyanalytics.io/script.js",
          defer: true,
          "data-site-id": "YOUR_SITE_ID",
        },
      ],
    },
  },
});
```

<Tip>
  Replace `YOUR_SITE_ID` with your real site ID. If you've toggled options in **Settings → Tracking**, add each one as another `"data-..."` key in the same object.
</Tip>

## Client-side navigation is tracked automatically

Nuxt renders route changes on the client, and tinyanalytics records each one as a new pageview by default (`data-track-spa`). Moving between pages is captured for you. 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 Vue" icon="vuejs" href="/docs/integrations/vue-analytics">
    A plain Vue (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

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