All Collections
Account Features
Install Widget
Install Widget - Additional Information
How to track events in the IFRAME with Google Tag Manager
How to track events in the IFRAME with Google Tag Manager
Updated over a week ago

To implement the iframe tracking you need to have 2 GTM-manager tags which will allow you to pass the events from the GTM installed inside the iframe to the page where this iframe is installed on.

  1. Create a new ‘child’ GTM

    Create a new 'child' GTM, specifically for the widget inside the iframe, and provide the installation code to DigiFabster so we install to the widget. This GTM will track events inside the <iframe> and push it to your parent GTM via Data Layer.

  2. Create a 'sender' tag

    In the new ‘child’ GTM create a 'sender' tag - js code which will push the events information to the Data Layer. Use a Custom HTML tag type to create it and specify the name of the event in the code. Then, add a specific Click ID trigger to it. Here you can find the example code that pushes the 'browseFiles' event to the Data Layer.

  3. Create a 'listener' tag

    In your ‘parent’ GTM create a 'listener' tag - js code which will trigger on each pageview and 'listens' to the data received in the Data Layer. Here you can find the example code that 'listens' to the event being pushed to the Data Layer on each page of the website.

  4. Create a custom event trigger

    As soon as this connection is ready, create a custom event trigger where you specify the exact same name of the event that you send via 'sender' tag in step 2.

  5. Create a GA Event

    The final step is to create the GA Event itself which sends the data to your Google Analytics. It should fire when your newly created custom event trigger is fired. That's just a simple Event setup where you can specify the category, action, label, etc. The only difference is the trigger - it should be a custom event. You can push the name of the event (label) to Google Analytics using the Data Layer Variable.

Did this answer your question?