Tracking Triggers & Events inside Maker Embeds

One of GTM's power features is the ability to create custom events that get "trigger"ed whenever a certain condition matches. Often, this means you want to track a certain event on a specific URL.

This URL based trigger doesn't work on iFrame embeds such as Maker embeds or YouTube out of the box. This is because iFrames are really just another website inside your website and all the web browsers respect this security model to prevent tampering on the embeds; and vice versa.

Fortunately, Maker has a well defined solution for this problem.

To track using GTM triggers and events inside the iframe using your site's URL, Maker has a special dataLayer variable called makerEmbedParentPageUrl that contains the parent page's (i.e. WineAccess) URL. This is because the Maker iFrame is essentially a secured, sandboxed website with its own URL and environment.

Pre-Requisite - Cross Domain Tracking

Before you begin, we highly recommend that you have setup GTM on Maker & Cross Domain Tracking. Cross Domain Tracking ensures that we don't count your customers' sessions twice - i.e. once on your page and once on Maker Embed. 

1. Create a new User-Defined Variable 

2. Example Trigger 

Now that we have that one time variable setup out of the way, let's walk through an example of how to create a new Trigger that will only run when your customers click on a CTA on a particular page on your  site. Let's say this page has the words "amazing-landing-page" in the URL and that the CTA contains a link with the words "killer/cta"

In the last step above, Select "Some Link Clicks". 

Then Add a couple rules that will run inside the Maker Embed:

First rule is that we want this to trigger on links clicked with the URL "killer/cta" 

We also only wanna make this run on a specific page on your site. Instead of using the GTM provided URL variable (which won't work with iFrames), we are going to use our new custom variable that we created in the first Step. 

Select the "Maker Embed Parent Page URL" and set it to match the URL "amazing-landing-page" 

3. Linking Triggers to Your Tags

Now that you've created a Trigger, you can use it with your existing Tags quite easily. 

Once you setup the trigger with the tag, don't forget to save your changes and Publish it your Tag Manager.

To test your changes - please go to your landing page and use Google's Tag Assistant for testing the whole flow. If you setup everything correctly, you should see your  event above fire in the report.

maker