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

# WordPress Analytics Integration

> Install tinyanalytics in the WordPress header with a code plugin or your theme, so the tracking script loads on every page.

To add tinyanalytics to **WordPress**, put the tracking snippet in your site's `<head>` so it loads on every page. The easiest way is a headers-and-footers code plugin — no theme editing required. If you're comfortable with code, you can add it to your theme instead.

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

## Option 1: A header code plugin (recommended)

The simplest approach, and it survives theme updates:

<Steps>
  <Step title="Install a headers-and-footers plugin">
    From **Plugins → Add New**, install and activate a plugin that inserts code into your site header (for example, a "headers and footers" or "insert code" plugin).
  </Step>

  <Step title="Paste the snippet into the header">
    In the plugin's settings, paste your tinyanalytics snippet into the **header** (`<head>`) section and save.

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

## Option 2: Your theme's header

If you'd rather not add a plugin, paste the snippet into your theme's `header.php`, just before the closing `</head>` tag.

<Warning>
  Edit a **child theme**, not the parent — a theme update will overwrite `header.php` in the parent theme and remove your snippet. A header code plugin (Option 1) avoids this entirely.
</Warning>

## Verify

Open your site 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 any platform" icon="puzzle-piece" href="/docs/integrations/install-website-analytics">
    The universal method and other platforms.
  </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>

  <Card title="Track custom events" icon="hand-pointer" href="/docs/custom-event-tracking">
    Measure signups, clicks, and purchases.
  </Card>
</Columns>


## Related topics

- [VitePress Analytics Integration](/docs/integrations/vitepress-analytics.md)
- [WooCommerce Analytics Integration](/docs/integrations/woocommerce-analytics.md)
- [Install tinyanalytics in 5 Minutes](/docs/tinyanalytics-quickstart.md)
