9.5 Configure Google Tag Manager Tags & Triggers

After creating the extensions and data elements, it’s time to build our rules or “triggers” as they are called in Google Tag Manager.

Go to https://tagmanager.google.com/ and login with your personal login details.

9.5.1 - Configure Trigger: All General Pages

In the Google Tag Manager menu, go to Triggers.

Launch Setup

Click on New.

Launch Setup

Our first trigger will fire on All General Pages.
As a name for this trigger, let’s use All General Pages.

Launch Setup

We need to configure a trigger this rule, so let’s click on the Trigger Configuration.

Launch Setup

This trigger should be activated on certain Page Views, so let’s select Page View.

Launch Setup

Then select Some Page Views and specify that the trigger should be fired when pageType equals General.

Launch Setup

Click Save to save your trigger.

Launch Setup

9.5.2 - Configure Trigger: All Product Pages

In Triggers, click New.

Launch Setup

Our second trigger will fire on All Product Pages.
As a name for this trigger, let’s use All Product Pages.

Launch Setup

We need to configure a trigger this rule, so let’s click on the Trigger Configuration.

Launch Setup

This trigger should be activated on certain Page Views, so let’s select Page View.

Launch Setup

Then select Some Page Views and specify that the trigger should be fired when pageType equals Products

Launch Setup

Click Save to save your trigger.

Launch Setup

9.5.3 - Configure Trigger: All Authenticated Pages

In Triggers, click New.

Launch Setup

Our third trigger will fire on All Authenticated Pages.
As a name for this trigger, let’s use All Authenticated Pages.

Launch Setup

We need to configure a trigger this rule, so let’s click on the Trigger Configuration.

Launch Setup

This trigger should be activated on certain Page Views, so let’s select Page View.

Launch Setup

Then select Some Page Views and specify that the trigger should be fired when customerLoggedIn equals Yes.

Launch Setup

Click Save to save your trigger.

Launch Setup

With this, you’ve successfully finished the setup of your Triggers in Google Tag Manager.

Let’s now configure the Tags to send to Adobe Experience Platform and link the Triggers that you just built to those Tags.

9.5.4 - Configure Tag: All General Pages

In the Google Tag Manager menu, go to Tags.

Launch Setup

Click on New.

Launch Setup

Our first tag will fire on All General Pages.
As a name for this tag, let’s use All General Pages.

Launch Setup

Click on Triggering to link the you created to this tag.

Launch Setup

Choose your All General Pages - trigger.

Launch Setup

Click Add to add your trigger to this tag.

Launch Setup

Next, click on Tag Configuration.

Launch Setup

In the menu, select Custom HTML.

Launch Setup

Paste this code in the Tag:

<script>
console.log(">>>>> GA - All General Pages - Sending PageView to DCS");
  
fetch("{{dcsStreamingEndpoint}}", {"credentials":"omit","headers":{"accept":"*/*","accept-language":"en-US,es;q=0.9,en;q=0.8","cache-control":"no-cache","content-type":"application/json","pragma":"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"cross-site"},"referrer":"{{pageUrl}}","referrerPolicy":"no-referrer-when-downgrade","body":"{\"header\":{\"datasetId\":\"{{eeDatasetId}}\",\"imsOrgId\":\"{{imsOrgId}}\",\"source\":{\"name\":\"GA\"},\"schemaRef\":{\"id\":\"{{eeSchemaRef}}\",\"contentType\":\"application/vnd.adobe.xed-full+json;version=1\"}},\"body\":{\"xdmMeta\":{\"schemaRef\":{\"id\":\"{{eeSchemaRef}}\",\"contentType\":\"application/vnd.adobe.xed-full+json;version=1\"}},\"xdmEntity\":{\"_id\":\"{{pageHitId}}\",\"web\":{\"webPageDetails\":{\"name\":\"{{pageName}}\",\"pageViews\":{\"value\":1}}},\"timestamp\":\"{{pageTimeStamp}}\",\"environment\":{\"browserDetails\":{\"userAgent\":\"{{pageUserAgent}}\",\"acceptLanguage\":\"{{customerLanguage}}\"}},\"identityMap\":{\"GOOGLE\":[{\"id\":\"{{gaClientId}}\"}]},\"{{aepTenantId}}\":{\"brand\":{\"brandName\":\"{{brandName}}\",\"tms\":\"GTM\"},\"identification\":{\"gaid\":\"{{gaClientId}}\"}}}}}","method":"POST","mode":"cors"});
</script>

Your configuration should now look like this:

Launch Setup

9.5.5 - Configure Tag: All Product Pages

In the Google Tag Manager menu, go to Tags.

Launch Setup

Click on New.

Launch Setup

Our first tag will fire on All Product Pages.
As a name for this tag, let’s use All Product Pages.

Launch Setup

Click on Triggering to link the you created to this tag.

Launch Setup

Choose your All Product Pages trigger.

Launch Setup

Click Add to add your trigger to this tag.

Launch Setup

Next, click on Tag Configuration.

Launch Setup

In the menu, select Custom HTML.

Launch Setup

Paste this code in the Tag:

<script>
console.log(">>>>> GA - All Product Pages - Sending Product View to DCS");
  
fetch("{{dcsStreamingEndpoint}}", {"credentials":"omit","headers":{"accept":"*/*","accept-language":"en,nl;q=0.9,en-US;q=0.8,en-GB;q=0.7,sv;q=0.6,it;q=0.5,fr;q=0.4,es;q=0.3,da;q=0.2,de;q=0.1","content-type":"application/json","sec-fetch-mode":"cors","sec-fetch-site":"cross-site"},"referrer":"{{pageUrl}}","referrerPolicy":"no-referrer-when-downgrade","body":"{\"header\":{\"datasetId\":\"{{eeDatasetId}}\",\"imsOrgId\":\"{{imsOrgId}}\",\"source\":{\"name\":\"GA\"},\"schemaRef\":{\"id\":\"{{eeSchemaRef}}\",\"contentType\":\"application/vnd.adobe.xed-full+json;version=1\"}},\"body\":{\"xdmMeta\":{\"schemaRef\":{\"id\":\"{{eeSchemaRef}}\",\"contentType\":\"application/vnd.adobe.xed-full+json;version=1\"}},\"xdmEntity\":{\"_id\":\"{{pageHitId}}\",\"web\":{\"webPageDetails\":{\"name\":\"{{pageName}}\"}},\"commerce\":{\"productViews\":{\"value\":1}},\"timestamp\":\"{{pageTimeStamp}}\",\"environment\":{\"browserDetails\":{\"userAgent\":\"{{pageUserAgent}}\",\"acceptLanguage\":\"{{customerLanguage}}\"}},\"identityMap\":{\"GOOGLE\":[{\"id\":\"{{gaClientId}}\"}]},\"productListItems\":[{\"SKU\":\"{{productName}}\",\"priceTotal\":{{productPrice}},\"quantity\":1,\"name\":\"{{productName}}\",\"product\":\"{{productImageUrl}}\",\"productAddMethod\":\"Desktop\"}],\"{{aepTenantId}}\":{\"brand\":{\"brandName\":\"{{brandName}}\",\"tms\":\"GTM\"},\"productData\":{\"productUrl\":\"{{productImageUrl}}\",\"productName\":\"{{productName}}\",\"productInteraction\":\"{{productInteraction}}\"},\"identification\":{\"gaid\":\"{{gaClientId}}\"}}}}}","method":"POST","mode":"cors"});
</script>

Your configuration should now look like this:

Launch Setup

9.5.6 - Configure Tag: All Authenticated Pages

In the Google Tag Manager menu, go to Tags.

Launch Setup

Click on New.

Launch Setup

Our first tag will fire on All Authenticated Pages.
As a name for this tag, let’s use All Authenticated Pages.

Launch Setup

Click on Triggering to link the you created to this tag.

Launch Setup

Choose your All Authenticated Pages trigger.

Launch Setup

Click Add to add your trigger to this tag.

Launch Setup

Next, click on Tag Configuration.

Launch Setup

In the menu, select Custom HTML.

Launch Setup

Paste this code in the Tag:

<script>
console.log(">>>>> GA - All Authenticated Pages - Sending PageView to DCS");
  
fetch("{{dcsStreamingEndpoint}}", {"credentials":"omit","headers":{"accept":"*/*","accept-language":"en,nl;q=0.9,en-US;q=0.8,en-GB;q=0.7,sv;q=0.6,it;q=0.5,fr;q=0.4,es;q=0.3,da;q=0.2,de;q=0.1","content-type":"application/json","sec-fetch-mode":"cors","sec-fetch-site":"cross-site"},"referrer":"{{pageUrl}}","referrerPolicy":"no-referrer-when-downgrade","body":"{\"header\":{\"datasetId\":\"{{profileDatasetId}}\",\"imsOrgId\":\"{{imsOrgId}}\",\"source\":{\"name\":\"GA\"},\"schemaRef\":{\"id\":\"{{profileSchemaRef}}\",\"contentType\":\"application/vnd.adobe.xed-full+json;version=1\"}},\"body\":{\"xdmMeta\":{\"schemaRef\":{\"id\":\"{{profileSchemaRef}}\",\"contentType\":\"application/vnd.adobe.xed-full+json;version=1\"}},\"xdmEntity\":{\"_id\":\"{{pageHitId}}\",\"_repo\":{\"createDate\":\"{{pageTimeStamp}}\"},\"person\":{\"name\":{\"lastName\":\"{{customerLastName}}\",\"firstName\":\"{{customerFirstName}}\"}},\"{{aepTenantId}}\":{\"identification\":{\"gaid\":\"{{gaClientId}}\",\"emailId\":\"{{customerEmail}}\",\"mobilenr\":\"{{customerMobileNr}}\"}}}}}","method":"POST","mode":"cors"});
</script>

Your configuration should now look like this:

Launch Setup

You can now publish you configuration in the next exercise.

Next Step: 9.6 Publish Google Tag Manager Property

Go Back to Module 9

Go Back to All Modules

On this page

Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now