> ## Documentation Index
> Fetch the complete documentation index at: https://docs.claimr.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Tag Manager integration

> Use GTM to manage your Claimr tracking and other marketing tags without directly modifying your website's code.

Google Tag Manager provides a centralized platform for managing tracking codes (tags) for various services, including Google Analytics, advertising platforms, and more.

Claimr supports two methods for integrating with GTM:

## Method 1: Using the data-gtm attribute in the embed script

This method is the most straightforward and is recommended for most setups. You add your GTM Container ID (which looks like `GT-XXXXXXXXX`, `G-XXXXXXXXX`, or `AW-XXXXXXXXX`) directly to the Claimr embed script.

<Steps>
  <Step title="Find your GTM Container ID">
    * Log in to your Google Tag Manager account.
    * Select the container you want to use for your Claimr widget.
    * Your Container ID will be displayed prominently on the container's overview page (e.g., `GT-XXXXXXX`).

    For more detailed instructions, refer to Google Tag Manager's documentation: [Set up and install Tag Manager](https://support.google.com/tagmanager/answer/6103696?hl=en).
  </Step>

  <Step title="Modify your Claimr embed script">
    Add the `data-gtm` attribute to your Claimr script tag, replacing `"GTM-TAG"` with your actual GTM Container ID:

    ```html theme={"dark"}
    <script src="https://widgets.claimr.io/claimr.min.js"
        id="claimr-script"
        data-gtm="GT-XXXXXXX"
        data-organization="ORGANIZATION_NAME"
        data-campaign="CAMPAIGN_NAME"
        data-autoresize="true"
        data-container="CLAIMR_CONTAINER_ID">
    </script>
    ```

    Replace `ORGANIZATION_NAME`, `CAMPAIGN_NAME`, and `CLAIMR_CONTAINER_ID` with actual values.
  </Step>
</Steps>

## Method 2: Passing the GTM container ID in the URL

This method is useful if you can't directly modify the embed script or if you need to dynamically change the GTM Container ID.

1. **Find your GTM Container ID:** (Same as Method 1)
2. **Construct the URL:** Add the `gtm` parameter to your Claimr campaign URL, replacing `"GTM-TAG"` with your actual GTM Container ID:

```
https://campaign?gtm=GTM-XXXXXXX
```

Replace `https://campaign` with your actual Claimr campaign URL.

## Verifying GTM integration

After implementing either method, you'll need to configure your Claimr events *within* Google Tag Manager. This typically involves creating:

1. **Triggers:** These define *when* to fire a tag (e.g., when a specific Claimr event occurs).
2. **Tags:** These send data to your analytics or marketing platforms (e.g., a Google Analytics 4 event tag).
3. **Variables**

View our documentation for the specific event names and data that are available for tracking.

Once your GTM configuration is complete and published, you should start seeing Claimr events in your connected platforms (e.g., Google Analytics). Use the Real-time reports in those platforms to verify that data is being received correctly.
