Iframe Cross Domain Tracking With GTM

Here I love to share the easiest way of GTM iframe tracking that I found ever. So, borrowing some code from GTM expert that everyone know – Simo Ahava.

I tested this below condition and was working well.

So, into the topic. Basically, we need only a CustomJs GTM variable with hitcall back function and rest is magic.  😀

Step I

Create a customJs variable named callBack

Please refer – Orginal Blog Post for code explained.

Step II

Now, at the Universal Analytics tag in GTM  >> MoreSettings > Fields to set >> the add :

hitcallback with variable {{callback}

 

Done!  like magic, your iframe link will be decorated. To check if its working use RealTime Analytics or Inspect element to find cid appended to iframe.

Check live at http://ignore-test.com/iframe/iframe.html