Here, you’ll be able to find any identifying information about the element you want to track. Right-click on your iframe and select View Frame Source. Remember how we checked our iframe code earlier? Here’s where this comes in handy. Next, you’ll have to decide which user actions you want to track inside your iframe. If you don’t already have GTM installed on your parent frame (primary website), then check out our GTM Installation Guide to get started. Your parent frame should have its own account and container. This doesn’t mean you need a separate Google login, but you’ll want a GTM account and container that are specific to your child frame. The important part here is that you should create a new Google Tag Manager account to associate with your child frame. So if you want to track any form submissions, button clicks, or element visibility in your iframe, you need to also install GTM onto your child frame. Install GTM on Your Child IframeĮven if you already have GTM installed on the website that contains the iframe, it won’t be able to pick up any user interactions that occur inside the iframe. Here’s an overview of how that works in more detail. If that sounds complicated, I promise it’s not. The parent frame listens to the call with Google Tag Manager, then forwards it to your marketing tools. You can track iframe interactions by sending a Javascript call called postMessage from the iframe to the parent frame. How to Push Data From Your Iframe to Your Parent Frame If you click View Frame Source, you’ll see the HTML code for the source website (the child frame), which will look different from the code for the web page you’re on (the parent frame). If you see the option View Frame Source, then the element is an iframe. To inspect a page element, right-click (or control-click for Mac) wherever you suspect there’s an iframe. Not sure if your page element is an iframe? You can do a simple check on the frontend of your website. Without access to the iframe in question, you cannot install any tracking code. 80% of the cases I see where people are struggling with tracking iframes are simply not possible. This means the source website’s code, not the iframe HTML on your website. □ Note: To reiterate, you need developer access to the iframe in question. If you already have Google Tag Manager installed, then even better. If you want to track an iframe, make sure that you will have developer access to the website inside your iframe. The iframe contains another website, so unless you are the owner of the website in your iframe, you won’t be able to do any tracking at all.
0 Comments
Leave a Reply. |