: Using Google Analytics to track my content in iframe on third-party sites? I have built a small visualisation and I want to allow third-party users to embed it within an iframe on their pages.
I have built a small visualisation and I want to allow third-party users to embed it within an iframe on their pages.
When they do this, I would like to use Analytics to track (i) how many people have seen the visualisation and (ii) the URLs on which it has been embedded.
The HTML and JS of my visualisation are both on the same domain, but obviously my domain is different from the domains on which it has been embedded.
I have read Google's documentation on iframes but it isn't helping me a great deal!
Two questions:
Can I just use the basic Analytics setup in the normal way in my HTML, or are there any issues I need to be aware of?
How do I pass in the parent URL as a custom dimension? Presumably I can't just get the URL of the parent page, for security reasons, so I'm wondering if I need to do something like this?
More posts by @Turnbaugh106
1 Comments
Sorted by latest first Latest Oldest Best
Be sure to use a custom tracker object for your Google Analytics script. The reason behind this is if a site is running Google Analytics, then their script calls might end up being recorded in your account as well!
So you cannot use the default GA script, but would rather use this Google Developer documentation on Creating Trackers.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.