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

# Install the tinyanalytics Tracking Script

> Add the tinyanalytics tracking script to your site to start collecting pageviews and events automatically — one script tag, under 6.5 KB gzipped.

The tinyanalytics tracking script is a single `<script>` tag you add to your site's HTML `<head>`. Once it's live, tinyanalytics collects pageviews and common interactions automatically — you don't have to write any code to get started. The script is under **6.5 KB** gzipped, loads with `defer`, and never blocks your page.

## Prerequisites

* A tinyanalytics account and a site added in the dashboard. If you haven't done this yet, follow the [Quickstart](/docs/tinyanalytics-quickstart).

## Install the script

<Steps>
  <Step title="Copy the script from your dashboard">
    Open your site in tinyanalytics. On a new site, the tracking script is on the setup panel; on an existing site, it's in **Settings → Tracking**. Copy the tag exactly as shown — it already includes your numeric `data-site-id`:

    ```html theme={null}
    <script defer src="https://dash.tinyanalytics.io/script.js" data-site-id="123"></script>
    ```
  </Step>

  <Step title="Paste it into your HTML head">
    Add the tracking script before the closing `</head>` tag, on every page you want to measure. Placing it in the `<head>` means visits are recorded as soon as the page loads.
  </Step>

  <Step title="Deploy and check">
    Publish your site, visit a page, and open your dashboard.
  </Step>
</Steps>

<Check>
  The install is working when your own visit appears in the dashboard within a few seconds. If it doesn't, see [verify your setup](/docs/verify-tinyanalytics-installation).
</Check>

## What the script tracks out of the box

With the default tracking script, tinyanalytics captures the following automatically — no extra code:

* **Pageviews**, including client-side route changes in single-page apps.
* **Outbound link clicks** and **file downloads**.
* **Button clicks**, **text copies**, and **form submissions** (form shape only — field values are never captured).
* **Engagement** — scroll depth and engaged time per page visit.

You can turn any of these off, and turn on optional captures like Web Vitals, with [`data-*` attributes](/docs/configure-tinyanalytics-tracking-script).

## Where do I get my tracking script?

Always copy the tracking script from your dashboard. It fills in the correct `data-site-id` and uses the exact script URL for your account. Find it on a new site's setup panel, or under **Settings → Tracking** for any existing site. Copy it rather than typing it by hand.

## Framework and CMS installs

The install is the same everywhere — the tracking script goes in the HTML `<head>` — but where you paste it differs by platform:

* **HTML sites** — paste directly into your `<head>`.
* **Frameworks** (Next.js, React, Vue, Svelte, and others) — add the tag to your root layout or document head component so it loads on every route. Single-page route changes are tracked automatically ([SPA routing](/docs/configure-tinyanalytics-tracking-script#track-single-page-apps) is on by default).
* **Site builders and CMSs** (WordPress, Webflow, Framer, Ghost, and others) — use the platform's "custom code" or "head" setting to add the tracking script site-wide.

Step-by-step integration guides for individual platforms are being added. Until then, the rule is the same on every platform: put the tracking script in the `<head>` on every page.

## Bypass ad blockers

Some ad blockers block third-party analytics requests, which can undercount visits. tinyanalytics supports serving the script and receiving events through a **first-party proxy** on your own domain, so tracking looks like part of your site. You point the tracking script's `src` at your own domain, and requests are forwarded to tinyanalytics behind the scenes.

<Note>
  A dedicated proxy and custom-domain guide is being added. If you need it now, contact support from your dashboard.
</Note>

## Frequently asked questions

<AccordionGroup>
  <Accordion title="Does the tinyanalytics tracking script slow down my site?">
    No. The tinyanalytics tracking script is under **6.5 KB** gzipped and loads with `defer`, so the browser runs it after the HTML has parsed. It never blocks your page from loading.
  </Accordion>

  <Accordion title="Do I have to add the tracking script to every page?">
    Yes — add it to every page you want to measure. On a framework or CMS, add it once in a shared root layout, template, or "custom code" head setting so it loads site-wide instead of pasting it per page.
  </Accordion>

  <Accordion title="Why is tinyanalytics undercounting my visits?">
    Ad blockers are the usual cause: some block third-party analytics requests before they're sent. Serve the tinyanalytics tracking script through a **first-party proxy** on your own domain so requests look like part of your site and aren't blocked.
  </Accordion>

  <Accordion title="Where do I find my site ID?">
    Your numeric `data-site-id` is already filled in on the tracking script shown in your dashboard — on a new site's setup panel, or under **Settings → Tracking** for an existing site. Copy the tag from there rather than typing the ID by hand.
  </Accordion>
</AccordionGroup>

## Related

<Columns cols={2}>
  <Card title="Configure the script" icon="sliders" href="/docs/configure-tinyanalytics-tracking-script">
    Every `data-*` attribute and what it controls.
  </Card>

  <Card title="Verify your setup" icon="circle-check" href="/docs/verify-tinyanalytics-installation">
    Confirm the install and fix common problems.
  </Card>

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

  <Card title="How tinyanalytics works" icon="diagram-project" href="/docs/how-tinyanalytics-works">
    What the script sends and how it's counted.
  </Card>
</Columns>


## Related topics

- [Configure the tinyanalytics Tracking Script](/docs/configure-tinyanalytics-tracking-script.md)
- [Install tinyanalytics in 5 Minutes](/docs/tinyanalytics-quickstart.md)
- [Install tinyanalytics on Any Website](/docs/integrations/install-website-analytics.md)
