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

# Google Tag Manager Analytics Integration

> Install tinyanalytics with a Google Tag Manager Custom HTML tag that fires on all pages, without changing your site's source code.

To add tinyanalytics through **Google Tag Manager (GTM)**, create a Custom HTML tag containing the tracking snippet and fire it on all pages. This keeps the install in your GTM container, so you don't touch your site's code.

## Before you start

* A tinyanalytics site. If you don't have one yet, follow the [Quickstart](/docs/tinyanalytics-quickstart).
* Your snippet from **Settings → Tracking** in your dashboard.
* GTM already installed on your site, with a container you can edit.

## Create a Custom HTML tag

<Steps>
  <Step title="Add a new Custom HTML tag">
    In your GTM workspace, go to **Tags → New**, and choose the **Custom HTML** tag type.
  </Step>

  <Step title="Paste the snippet">
    Paste your tinyanalytics snippet as the tag's HTML:

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

  <Step title="Trigger it on all pages">
    Set the tag's trigger to **All Pages** so it loads everywhere on your site.
  </Step>

  <Step title="Submit and publish">
    Save the tag, then **Submit** and **Publish** your container. The tag is live once the container is published.
  </Step>
</Steps>

<Tip>
  Replace `YOUR_SITE_ID` with your real site ID, and copy the full snippet from **Settings → Tracking** if you've toggled any options.
</Tip>

<Note>
  If you use GTM's consent settings, make sure the tag is allowed to fire — a tag blocked by consent won't load tinyanalytics. Core anonymous analytics uses no cookies or stored browser ID, but optional features can use browser storage. See [Privacy & GDPR](/docs/resources/privacy-friendly-analytics-gdpr) when configuring consent.
</Note>

## Verify

Use GTM **Preview** to confirm the tag fires, then open your site and 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 the tag fires in GTM **Preview** and your own visit appears in **Realtime** in your dashboard.
</Check>

## Related

<Columns cols={2}>
  <Card title="Install on any platform" icon="puzzle-piece" href="/docs/integrations/install-website-analytics">
    The universal method and other platforms.
  </Card>

  <Card title="How tinyanalytics works" icon="diagram-project" href="/docs/how-tinyanalytics-works">
    Why cookieless tracking simplifies consent.
  </Card>

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

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


## Related topics

- [Drupal Analytics Integration](/docs/integrations/drupal-analytics.md)
- [Install tinyanalytics on Any Website](/docs/integrations/install-website-analytics.md)
- [Laravel Analytics Integration](/docs/integrations/laravel-analytics.md)
