Google Analytics integration

Claimr supports two methods for integrating with GA4:

Method 1: Using the data-ga4 attribute in the embed script

This is the recommended method for most implementations. You add your GA Measurement ID (which looks like G-XXXXXXXXXX or GA4-KEY) directly to the claimr embed script.

  1. Find your GA measurement ID:

    • Log in to your Google Analytics account.

    • Go to the Admin section.

    • In the Property column, select your GA property.

    • Click on "Data streams," then select your web data stream.

    • Your Measurement ID will be displayed at the top. It typically starts with "G-".

    For detailed instructions, see Google's documentation: Find your Google tag ID

  2. Modify your claimr embed script: Add the data-ga4 attribute to your claimr script tag, replacing "GA4-KEY" with your actual Measurement ID:

    <script src="https://widgets.claimr.io/claimr.min.js"
        id="claimr-script"
        data-ga4="G-XXXXXXXXXX"  data-organization="ORGANIZATION_NAME"
        data-campaign="CAMPAIGN_NAME"
        data-autoresize="true"
        data-container="CLAIMR_CONTAINER_ID">
    </script>

    Make sure you replace ORGANIZATION_NAME, CAMPAIGN_NAME, and CLAIMR_CONTAINER_ID with your actual values.

Method 2: Passing the GA4 Key in the URL

This method is useful if you cannot directly modify the embed script, or if you need to dynamically change the GA4 Measurement ID.

  1. Find your GA4 measurement ID: (Same as Method 1)

  2. Construct the URL: Add the ga4 parameter to your claimr campaign URL, replacing "GA4-KEY" with your actual Measurement ID:

    https://campaign?ga4=GA4-KEY

Verifying GA4 integration

After implementing either method, you should start seeing events from your claimr widget in your GA4 Realtime reports. It may take a few minutes for data to appear. You can use the Realtime view to test if events are being tracked correctly.

Last updated

Was this helpful?