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.
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
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.
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.
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.Create a Custom Event trigger per event you care about
In GTM, using the exact names you observed.
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.
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.
gclidandfbclidare 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 see | What it means |
|---|---|
| No events in the dataLayer at all | Script missing, above the iframe, or in a text block instead of an HTML block. |
| Events in the console, nothing in GTM | Trigger name does not match the actual event name. Check character by character. |
| Works in preview, not live | The container was not published, or the page is cached. |
| Some visitors tracked, others not | Ad blockers and consent. Expected. |
| A trigger permanently at zero | Almost 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.
