Developer guide

Advanced tracking and attribution

Getting estimator events into Google Tag Manager when the estimator is inside an iframe, and why the obvious approach does not work.

For developers and agencies45 minutesYou need: GTM access and the ability to edit the page

Google Tag Manager cannot see inside a cross-domain iframe, so estimator activity is invisible to it by default. The fix is a passthrough script on your estimator page that receives messages from the iframe and pushes them into your dataLayer, where GTM can pick them up as custom events.

Before you build anything on event names: open GTM's preview mode or your dataLayer in the console, run your own estimator end to end, and write down exactly what fires. Build your triggers from that list.

We are saying this plainly because event naming has changed over time, and published lists have not always kept up. A trigger built on a name that no longer fires sits silently at zero and looks like a tracking failure for weeks. Two minutes watching your own dataLayer is worth more than any list, including this page.

Why GTM cannot see inside the iframe

The estimator is served from a different domain. Browsers deliberately prevent scripts on your page from reading inside a cross-origin frame, which is a security feature rather than a limitation to work around. The supported route is for the frame to send messages out, and for your page to listen for them.

What to do

  1. Get the current passthrough script

    From [email protected]. Ask for the current version rather than reusing one from an older document, because this is exactly the kind of thing that goes stale.

  2. Place it on every page with an estimator embedded

    In an HTML block, after the iframe. If you have the estimator on several pages, it goes on all of them.

  3. Confirm events reach your dataLayer

    Open GTM preview, or the browser console, and run through the estimator. You should see events arriving as you go.

    What good looks like: you can name every event that fires, because you watched it happen.
  4. Create a Custom Event trigger per event you care about

    In GTM, using the exact names you observed.

  5. Add Data Layer Variables for anything you want to pass on

    Optional, but needed if you want values rather than just the fact something happened.

  6. Wire up your tags

    GA4 events, Meta conversions, whatever you use. Test each in preview before publishing.

Also worth knowing

  • UTMs need their own passthrough. Separate problem, same cause. See passing UTM parameters.
  • Click IDs are not captured. gclid and fbclid are not currently stored with estimates, which limits offline conversion upload. Standard UTMs are.
  • Consent tooling affects this. If your banner blocks scripts before consent, events will not fire until consent is given. Correct behaviour, but it explains gaps.
  • Your notification emails are the source of truth for lead counts. Analytics will always undercount because of blockers and consent.

Troubleshooting

What you seeWhat it means
No events in the dataLayer at allScript missing, above the iframe, or in a text block instead of an HTML block.
Events in the console, nothing in GTMTrigger name does not match the actual event name. Check character by character.
Works in preview, not liveThe container was not published, or the page is cached.
Some visitors tracked, others notAd blockers and consent. Expected.
A trigger permanently at zeroAlmost always an event name that does not exist. Go and watch the dataLayer.
Can I avoid all this by using the direct link?

Yes. A direct link is same-origin from the estimator's point of view and needs none of this. You lose keeping visitors on your own domain.

Does this work with server-side GTM?

Events reach the dataLayer first, so you can forward from there as usual.

Can I get the estimate value as a conversion value?

Ask support what is currently exposed rather than assuming from an older document.

Email [email protected] for the current script and the current event list.

For franchises
OverviewRoyalty calculatorCase studies
For contractors
OverviewFeaturesExample estimatorsFree book for contractors
Why publish prices Pricing
Resources
Marcus’s pricing masterclassHow it worksIntegrationsLearn CenterFAQAbout us
Log in