Tracking Custom Iframe Events In Google Tag Manager
I have some IFRAMEs on my pages for external services -- AddThis, YouTube, and a JWPlayer-based custom video solution. I want to use GTM to track clicks and responses in those IFR
Solution 1:
It took me a while to figure it out, but basically:
- Create a GTM container and add the GTM codeblock to pages on your site.
- Create a ‘Tag’ to be your event listener.
- Create two ‘Triggers’: one for which pages to listen for the event, and one that fires when your event happens.
- Create one or more ‘Variables’ to store the info from your event listener ‘Tag’
- Create another ‘Tag’ to take the info you stored in the ‘Variables’ and pass it to Google Analytics.
- Go into the Google Analytics console and watch the events come in.
I wrote up a more complete, long-form guide at http://ieg.wnet.org/blog/using-google-tag-manager-for-custom-event-tracking/
Post a Comment for "Tracking Custom Iframe Events In Google Tag Manager"