The Google Tag Manager connector is an Experience OS extension that enables you to efficiently handle and deploy multiple tracking tags and code snippets on your site without manual coding.
This connector fires Google Analytics 4 events with variation information through your Google Tag Manager whenever a variation is served to your visitors. You can then use the information to create reports in your Google Analytics account filtered by users who were served any variation or campaign using Google Analytics metrics and reporting capabilities.
Note that this connector works only with Dynamic Yield script implementations.
If you're using our legacy Google Analytics integration to integrate your Google Tag Manager account, we recommend deactivating the integration and using this connector instead. It supports Google Analytics 4, and includes additional attributes you can pass to your analytics platform, such as campaign, variation, and experience IDs.
Install the connector
- In the Experience OS store, go to Google Tag Manager and click Learn More.
- On the Google Tag Manager page, click Install.
After you install the Google Tag Manager connector, it appears in your extension library in Web Personalization. In this view, you can disable and enable the connector as needed.
View Dynamic Yield campaigns in your Google Tag Manager account
When the integration is enabled, do the following:
Step 1: Create and configure a tag for Google Analytics
- In Google Tag Manager Workspace, click Tags, then click New, and select Google Analytics: GA4 Event from the list.
- Configure the tag as follows:
- Tag Configuration: Click, and then select None - Manually Set ID.
- Measurement ID: Enter your Google Analytics ID.
- Event Name: Enter “DY Variation Impression”.
- Click Add Row under Event Parameters, and define the following required parameter names and values:
- campaignID
- {{campaignID}}
- campaignName
- {{campaignName}}
- experienceID
- {{experienceID}}
- experienceName
- {{experienceName}}
- variationID
- {{variationID}}
- variationName
- {{variationName}}
- Save the tag.
Step 2: Create a new trigger
- In the Workspace, click Triggers, then click New, and select Custom Event from the list.
- Enter the Event Name DY Variation Impression, and then click Save.
Step 3: Create data layer variables
- In the Workspace, click Variables, then do the following for each variable you created in Step 1:
- Click New User-Defined Variable, and select Data-Layer Variable from the list.
- Enter the variable name exactly as it appears in your parameter list.
When you're done, your User-Defined Variables list should look like this:
Step 4: Connect your triggers and tags
- In the Workspace, click Tags, and then click the tag you created in Step 1 (DY Variation Impressions).
- In the Tag Configuration screen, in the Triggering area, click the Triggering icon, and then select the trigger you created in Step 2 (also DY Variation Impression).
Step 5: Save and submit
- Save the changes to the tag and the trigger, and click Submit.
- Publish the updated configuration changes
Disable Google Tag Manager for individual campaigns
By default, the connector triggers Google Tag Manager events for all of your campaigns. However, you can disable (and re-enable) it for individual campaigns using the Track campaign performance toggle in the Create Campaign screen. Note that if you have the Analytics Platform Integration connector installed, it will stop sending events to that extension as well.