Tracking users through iFrame elements
We have implemented UA with GTM. It's working. On some pages, we have iFrame scripts embedded which include their own UA tracking code. We need the UA tracking to remain in the iFrame elements because they provide useful data such as event tracking. We are using the same property ID throughout.
The issue is that one user is now counted twice: once from the page where GTM is implemented and once from the iFrame itself.
The million dollar question is: how do you prevent such double tracking of visitors?
One idea we had was to implement the instructions in the following article: Cross Domain tracking through iFrame, but we are unsure whether this will help or how we can implement this with Google Tag Manager.
Any help would be greatly appreciated!
Re: Tracking users through iFrame elements
similar to the guide you can use postMessage method with GTM as well or simply decorate the iframe src in order to pass cookie info from one domain to another. You can use this guide in order to push a postMessage GTM based solution:
Hope it helps.