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

# WooCommerce Analytics Integration

> Install tinyanalytics through the WordPress header, then measure WooCommerce sales with a purchase event on the order-received page.

WooCommerce runs on **WordPress**, so you install tinyanalytics exactly as you would on any WordPress site: put the tracking snippet in your site's `<head>` so it loads on every page — shop, cart, and checkout included. Then measure sales by tracking a purchase on the order-received page.

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

## Add the snippet to your header

The simplest method works on any WordPress site and survives theme updates:

<Steps>
  <Step title="Install a header code plugin">
    From **Plugins → Add New**, install and activate a headers-and-footers 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>

For the theme-based alternative (a child theme's `header.php`), see the [WordPress guide](/docs/integrations/wordpress-analytics) — every WordPress install method applies to WooCommerce.

## Track purchases

Because your WooCommerce checkout runs on your own site, the tracker is present on the **order-received** (thank-you) page. Fire a [custom event](/docs/custom-event-tracking) there to record each completed order, and include the order total as revenue:

```js theme={null}
window.tinyanalytics.event('purchase', { revenue: 49.0, currency: 'USD' })
```

Fill the amount in from the order shown on the thank-you page. You can then build a purchase [goal](/docs/conversion-goal-tracking) or a checkout [funnel](/docs/funnel-analytics) from that event.

## Verify

Open your store in a browser, then check **Realtime** in your dashboard for your visit. Place a test order and confirm the `purchase` event appears in your **Events** report. See [Verify your setup](/docs/verify-tinyanalytics-installation) for the full check.

<Check>
  Your install is working when your own visit appears in **Realtime** and a test order's `purchase` event appears in your **Events** report.
</Check>

## Related

<Columns cols={2}>
  <Card title="Install on WordPress" icon="wordpress" href="/docs/integrations/wordpress-analytics">
    Every WordPress install method applies here.
  </Card>

  <Card title="Track custom events" icon="hand-pointer" href="/docs/custom-event-tracking">
    Record purchases and other actions.
  </Card>

  <Card title="Goals" icon="bullseye" href="/docs/conversion-goal-tracking">
    Turn a purchase into a conversion metric.
  </Card>

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


## Related topics

- [BigCommerce Analytics Integration](/docs/integrations/bigcommerce-analytics.md)
- [Shopify Analytics Integration](/docs/integrations/shopify-analytics.md)
- [Install tinyanalytics on Any Website](/docs/integrations/install-website-analytics.md)
