javascript - Tracking custom IFRAME events in Google Tag Manager -


i have iframes on pages external services -- addthis, youtube, , jwplayer-based custom video solution. want use gtm track clicks , responses in iframes (particularly 'play' events on video) cross-domain policy prevents that. how make work -- , how work in gtm?

it took me while figure out, basically:

  • create gtm container , add gtm codeblock pages on site.
  • create ‘tag’ event listener.
  • create 2 ‘triggers’: 1 pages listen event, , 1 fires when event happens.
  • create 1 or more ‘variables’ store info event listener ‘tag’
  • create ‘tag’ take info stored in ‘variables’ , pass google analytics.
  • go google analytics console , watch events come in.

i wrote more complete, long-form guide @ http://ieg.wnet.org/blog/using-google-tag-manager-for-custom-event-tracking/


Comments