Tracking Conversions in Embedded Forms: HubSpot, Typeform, Calendly and Other Iframes
By Samarth Analytics · Published · Updated · Conversion Tracking · 7 min read
Summary: Embedded forms and booking widgets from HubSpot, Typeform, Calendly and similar tools usually live inside an iframe from another domain, which means Google Tag Manager on your page cannot see them. Form submission triggers never fire, and the most valuable conversions on many B2B sites go untracked or are counted from the wrong signal. This guide explains why, the three reliable ways to get the conversion out of the iframe, and how to keep attribution intact along the way.
Why iframe forms are invisible
Browsers isolate content from different domains. When a form or booking widget is embedded as an iframe served from the provider's domain, the page around it cannot read anything inside it - not the fields, not the submit button, not the confirmation message. Google Tag Manager runs on your page, so its form submission and click triggers cannot see an iframe from another domain at all.
The result is one of the most common gaps in B2B tracking. The demo request form, the consultation booking and the newsletter sign-up are often embedded tools, and they are often the conversions the business cares about most. Teams work around the gap with weak proxies - counting clicks on the area around the form, or treating a scroll to the form as a lead - and the bidding algorithms learn from those proxies. A proper conversion tracking setup gets the real signal out instead.
Three ways to get the signal out
- Listen for the provider's browser messages. Many embedded tools send a message to the parent page when something happens inside the iframe. A small listener on your page can catch it and push a clean event into the data layer.
- Redirect to a page you control. Most form and booking tools can send the user to a URL of your choice after completion. Your own thank-you page then becomes the conversion point, hardened as described in thank-you page vs event-based conversions.
- Use server-side integrations. The provider sends the submission to your CRM or a webhook, and the conversion is recorded from there - imported into ad platforms as an offline conversion or sent to GA4 through the Measurement Protocol.
Most mature setups combine the first or second method for immediate, browser-side attribution with the third for the qualified outcome.
Provider by provider
HubSpot's embedded forms post a message to the parent window when a form is submitted, identifying the event and the form. A listener that checks for that message and pushes a data layer event with the form ID gives GTM a reliable trigger. HubSpot also supports redirecting to a thank-you URL, which works as a fallback.
Typeform offers two routes. Its embed library exposes a submit callback, so if you load the form with the library rather than a plain iframe, you can push to the data layer directly from the callback. Alternatively, Typeform can redirect on completion and pass hidden field values into the redirect URL.
Calendly posts messages to the parent page as the visitor moves through the booking flow, including an event when a meeting is scheduled. Listening for the scheduled event, and only that event, gives you a booking conversion rather than a calendar view.
Other tools vary. Check the provider's documentation for "postMessage", "embed events" or "redirect after submit" before assuming a tool cannot be tracked.
Building the listener safely
A message listener is a few lines of custom HTML in GTM, but a careless one creates false conversions or security problems:
- Check the message origin against the provider's exact domain and ignore everything else. Any page in any iframe can post messages, including ads.
- Match the specific event that means success - a submitted form or a scheduled meeting - not every message the widget sends.
- Push one data layer event with a consistent name, such as
generate_leadorbooking_confirmed, plus the provider, form or event type ID, and any submission ID the message includes. - Guard against duplicates: some tools send more than one message for a single submission. Track IDs already pushed in the current page.
- Fire the listener tag early on pages that contain the embed, so it is in place before the user submits.
Tip: Name the data layer event after the business outcome, not the vendor. If you replace Typeform with another tool next year, the GA4 key event and every ad platform conversion can stay exactly as they are; only the listener changes.
Keeping attribution intact
Getting the conversion event is half the job. The other half is making sure the lead carries its source into the CRM, so qualified outcomes can be attributed later:
- Pass UTM parameters, the GA4 client ID and the Google click identifier into hidden fields in the embedded form. Most providers support hidden fields populated from the embed URL or a script.
- Store those values on the CRM record.
- When the lead qualifies or closes, import the outcome to Google Ads with the click identifier, as described in offline conversion import, and to GA4 with the client ID.
Enhanced conversions add one more wrinkle. The user's email and phone number are inside the iframe, so the browser tag on your page cannot read them for hashing. Send that data server-side from the CRM instead, where it is available and consented. Our offline and CRM conversion tracking guide covers the full pipeline.
What to count: submissions, bookings and qualified outcomes
Getting the event out of the iframe raises a second question: which event should the ad platforms optimise towards? Counting every form submission rewards campaigns that attract spam and low-intent enquiries. Counting only closed deals gives bidding too few signals, too late. Most B2B setups we build use a ladder:
- Submission or booking, tracked in the browser through the listener or redirect. It is immediate and plentiful, so it works as a secondary conversion and as the primary goal for new campaigns with little data.
- Qualified lead, imported from the CRM when sales or a scoring rule accepts the lead. This is the conversion most mature accounts should bid on.
- Opportunity and closed deal, imported later with value, for reporting and value-based bidding once volume allows.
For booking tools, there is one extra step: a booked meeting is not a held meeting. If no-shows are common, import "meeting held" from the calendar or CRM as the qualified stage. The listener tells you a booking happened; only your own systems know whether it was worth anything.
Testing embedded conversions
- Submit a real test entry and confirm one data layer event appears, with the right IDs, in GTM Preview.
- Submit the same form twice quickly and confirm duplicates are suppressed.
- Check the event arrives in GA4 DebugView and in each ad platform's conversion diagnostics.
- Confirm the CRM record contains the hidden field values.
- Repeat on mobile, where some providers render a different flow.
- Compare a week of tracked conversions with CRM submissions. A ratio near one is the goal; anything far from it means the listener or the redirect is missing cases. Analysing drop-off before submission is covered in form analytics: field vs form drop-off.
Final thoughts
Embedded forms and booking widgets are invisible to your tag manager by design, which is why so many B2B conversion setups quietly track the wrong thing. Listening for the provider's messages, redirecting to a page you control, and closing the loop through the CRM each recover the real signal. Use them together, keep the source data attached to the lead, and the conversions your bidding learns from will finally be the ones your sales team cares about.
If your most important forms live in iframes, a free audit will show whether they are being counted, and how accurately.
Topics: CRM integration, lead generation, Google Tag Manager, conversion tracking
More articles on the Samarth Analytics blog · Markdown version of this article