Analytics and Tracking

iframe Tracking

Also called Embedded frame tracking

Capturing what happens inside an embedded frame on your page, such as a hosted form, booking widget or payment window.

Quick facts: iframe Tracking

Category
Analytics and Tracking
Also called
Embedded frame tracking
Level
Advanced
Affects
Conversion tracking, session counts, form measurement, bidding signals
Where to see it
Google Tag Manager, browser developer tools, provider webhooks or callbacks
In this article4
  1. How iframe tracking works
  2. Why iframe tracking matters
  3. Where iframe tracking goes wrong
  4. What to do about it

How iframe tracking works

An iframe is a window on your page showing a document from somewhere else: a booking calendar, a hosted enquiry form, a payment window, a map, a video player. Browsers deliberately keep that window sealed. If the embedded document comes from a different domain, your page’s scripts cannot see inside it, cannot read what was typed and cannot detect a click. This is a security rule, not a configuration you have missed, and no tag manager setting turns it off.

That leaves a few honest routes. If the embed comes from your own domain, your scripts can reach into it and the frame can also write into the parent page’s data layer. If it comes from someone else, the provider has to cooperate: many send a message out of the frame that your page can listen for, and some offer their own conversion or webhook features. Failing all that, the outcome can be confirmed on the server when the booking or payment is recorded.

Why iframe tracking matters

The things businesses embed are almost always the things that make money. Appointment bookings, hosted enquiry forms, ticket purchases and payment steps are exactly the moments you need to measure, and they are exactly the moments hidden behind a frame. A site can look thoroughly tracked while every conversion happens in a box nobody can see into.

The consequence is not just a gap in reporting. Ad platforms learn from the conversions they receive, so an unmeasured booking widget starves automated bidding of the only signal that matters and makes paid campaigns look far worse than they are.

Where iframe tracking goes wrong

The most damaging mistake is loading your own analytics tag inside the frame. The frame counts as its own page, so you get extra pageviews, an artificially split session and a self-referral from your own domain, all while still failing to link the conversion to the visit that produced it.

The second is measuring a click on the frame instead of an outcome inside it. Recording that somebody clicked where the form appears tells you about interest, not about submissions, and if it is set up as a conversion it will report success for people who typed nothing.

The third is assuming a provider’s tracking counts as yours. A booking platform’s own dashboard may show submissions, but if those numbers never reach your analytics or your ad platform, they cannot be attributed to a channel or used for bidding.

What to do about it

Start by asking the provider what they publish: a message posted out of the frame, a callback, a webhook, or a redirect to a confirmation page on your own site. A redirect is the easiest of all, because the confirmation page is yours to tag normally.

Where a message is available, listen for it and push a single clear event into the data layer, then build the conversion on that event rather than on a form submission trigger that cannot see the form. Where nothing is available, send the outcome from the server, or replace the embed with a form you control. Then test it properly: complete a real booking and confirm one event arrives, not two, and that no extra session appears. If the site is full of embeds from different suppliers, a structured tracking audit will find the gaps faster than guesswork.

Do and do not

Do

  • Ask the provider what signal leaves the frame
  • Prefer a confirmation page on your own domain
  • Complete a real booking to verify one event fires

Do not

  • Load your analytics tag inside a third-party frame
  • Count a click on the frame as a conversion
  • Rely on the provider's dashboard for channel attribution

Questions people ask about this

Why can't Google Tag Manager see clicks inside an embedded form?

Because the browser blocks it. A frame loaded from another domain is isolated from the page around it, so scripts on your site cannot read its contents or detect clicks within it. This is a core browser security rule rather than a missing setting. The provider has to send information out of the frame for you to measure anything reliably.

Should I put my analytics tag inside the iframe?

Only if the frame is served from your own domain and you have thought about the consequences. Otherwise you create duplicate pageviews, a split session and your own domain appearing as a referral, while still not linking the conversion to the original visit. Prefer a message out of the frame, a webhook, or a confirmation page you control.

How do I track bookings from an embedded booking widget?

Ask the provider how they signal a completed booking. Many post a message out of the frame that your page can listen for, some offer webhooks, and some can redirect to a confirmation page on your own site, which is the simplest option. Build the conversion on that signal, then complete a real booking to verify it fires once.

Related terms

Found this useful?

Share it, or ask an AI to summarise it

Back to the glossary

Knowing the term is the easy part

Applying it to your own site and budget is the work. Book a call and I will tell you what actually applies to you.