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.

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

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

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

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.

Last updated

Was this helpful?