- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
11-09-2018 07:52 AM
I need to track an interaction of an embedded iFrame on a webpage in tealium by sending an event to GA.
Can someone please outline the steps I need to take to make this happen please. We cant put tealium or GA within the iframe.
Any help or steering massibvely appreciated.
11-09-2018 08:52 AM - edited 11-09-2018 08:54 AM
Hi @kopkacobana
This is difficult, especially if the iframe is on a different domain.
An event happening in the iframe will bubble up, but only as far as the body tag (so still within the iframe). Which means you can't add a listener to the parent document.
If you can add code to the page in the iframe, then you could try triggering an event on the window using
$(window).trigger("eventname")
and then adding the listener via an extension on the parent, using
$(window).on("eventname", function() { ... stuff... });
I have done something a bit hacky in the past where i used an onmouseover handler on the iframe element, and then within that function body I added another event handler for something within the iframe. I can't really remember the details but it seemed to work reasonably reliably.
Copyright All Rights Reserved © 2008-2023