Embedded booking widgets and iframe forms: why GA4 loses the source or shows a referral.
- “Calendly booking showing as direct in GA4”
- “embedded form shows my own website as referral in GA4”
- “iframe form conversion has no source in GA4”
- “GA4 iframe tracking”
- “track Calendly bookings in GA4 with GTM”
- “Typeform embed GA4 source lost”
- “cross-domain tracking for an iframe GA4”
- “booking widget breaks Google Ads conversion attribution”
Baris Asa, tracking consultant, London · Last checked: 12 November 2026
An embedded booking widget or form is a separate page from another domain, running inside yours. It has its own cookies. When its tag sends the booking to your GA4 property, GA4 sees a new visitor whose source is your own site (a referral) or (direct), not the ad or email that brought them. The fix is to count the booking on your own page, from the message the widget sends when it completes.The giveaway in GA4: bookings or form submissions credited to yoursite.co.uk / referral or (direct) / (none), while the paid and email sessions that landed on that page show few or no bookings of their own. Users and sessions run a little high, because every booking also counts as a new visitor.
This is the iframe version of F-205 , self-referrals and session fragmentation. Two neighbours look similar and have their own notes. If the visitor leaves your site for the provider’s own page and comes back, that’s cross-domain tracking. If the referral is a payment provider at checkout, see payment gateway showing as referral.
Why does the widget lose the source?
An iframe is a page inside the page. The booking widget in it is served from the provider’s domain, for example calendly.com, so to the browser it is a different site from yours. Three things follow.
Its own cookies. MDN describes content embedded from other sites in an iframe as third-party content, with third-party cookies. Your page’s _ga cookie belongs to your domain; the widget can’t read it. Safari and Firefox go further by default (Safari blocks such cookies; Firefox keeps a separate cookie jar per site). Chrome allows them by default, except in Incognito or when the user blocks them. Either way, the visitor inside the widget is never the visitor on your page.
Its own referrer. MDN says that inside a cross-origin iframe the referrer is, by default, the origin of the parent page. So a tag inside the widget reports your site as where the visitor came from.
No linker. Google’s cross-domain pages describe the linker decorating links when they are clicked, and forms when decorate_forms is set. They don’t mention iframes. Listing the provider’s domain under Configure your domains doesn’t carry your visitor into the frame.
So if the provider’s tag sends to your property, GA4 records a new user and a new session, from your own domain or with no source at all. Calendly’s help page states the second outcome plainly: without UTM tags on the scheduling link, GA shows the source as (direct). It doesn’t say how its events are sent; the checks below show what your property actually received. The visitor’s real session, the one that carries the Google Ads click or the email campaign, sits on your page and never hears about the booking.
How do I tell if this is my problem?
Two checks in GA4. The first needs no developer.
- The report. In GA4, Explore, start a free-form exploration. Add the dimensions Hostname and Event name, and the metric Event count. Google defines Hostname as the subdomain and domain of the URL the event was on. A booking or form event under the provider’s hostname (
calendly.com,form.typeform.com, and so on) was sent from the provider’s page, not yours. - The source. Swap Event name for Session source / medium and filter Hostname to the provider. Rows of your own domain as a referral, or
(direct) / (none), are this fault.
Then, if you want to see it happen, open your page in Chrome, open DevTools, Network, and filter for collect. Make a test booking. If a GA4 request goes out at the moment of booking and its Initiator column points to a script on the provider’s domain, the widget is sending to Google Analytics from inside the frame. GA4 requests go to a /g/collect address. If you see none at the moment of booking, the provider may send its data another way: rely on the exploration.
| WHERE IT’S COUNTED | VISITOR | SOURCE GA4 READS | VERDICT |
|---|---|---|---|
| Provider’s tag, inside the iframe | New, provider’s cookie | Your site, or (direct) | Fault |
| Your page, from the widget’s message | Same as your page | The ad or email | Correct |
| Your thank-you page, provider in unwanted referrals | Same as your page | The ad or email | Correct |
| Provider’s tag and your page together | Two visitors | Both | Double count |
If nothing shows under the provider’s hostname, the widget isn’t sending to your property, and a booking that isn’t counted at all is a different problem: start with Google Ads conversion tag fires, no conversions.
How do I fix it?
Count the booking where the visitor’s session already is: on your page. There are two routes. Pick one per widget.
Route 1: listen for the widget’s message
Most booking and form tools can post a message from the iframe to the page that embeds it, using the browser’s postMessage. You listen for it on your page and turn it into a dataLayer event.
- Calendly documents
calendly.event_scheduled, among others, posted to the parent window. Its help page warns that a plain<iframe>embed doesn’t support event tracking via postMessage: use its JavaScript embed (widget.js). - Typeform’s embed library has an
onSubmitcallback that runs after a successful submission. It also has an option,shareGaInstance, which Typeform describes as sharing your page’s Google Analytics instance with the form. That is a second way to count, not an extra: use it or the listener, never both, and test which visitor and source the submission lands under before you rely on it. - HubSpot’s updated forms editor documents window events such as
hs-form-event:on-submission:success. Legacy forms use a different method; check which editor built yours.
For Calendly in Google Tag Manager, a Custom HTML tag that fires on the pages with the widget:
<script>
window.addEventListener('message', function (e) {
if (e.origin !== 'https://calendly.com') return;
if (!e.data || e.data.event !== 'calendly.event_scheduled') return;
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ event: 'booking_complete', booking_tool: 'calendly' });
});
</script>
Then a GA4 event tag on a Custom Event trigger for booking_complete, and mark that event as a key event in GA4. The origin check matters: MDN says a listener that doesn’t verify origin lets any site send it messages. The listener has to be in place before the booking completes, so let the tag fire on page load, not later.
Route 2: send the visitor to your own thank-you page
Many tools can redirect after the booking or submission. If the redirect changes the whole page (not just the frame) to a thank-you page on your domain, your normal tag fires there. Typeform’s embed has a redirectTarget setting, _parent by default. Check the setting in your tool, and test that the address bar, not the frame, changes.
One catch. The redirect starts in the provider’s frame, so the thank-you page can arrive with the provider’s domain as its referrer, and GA4 would credit the booking to calendly.com / referral. Add the provider’s domain to the unwanted-referrals list (Admin, Data streams, your web stream, Configure tag settings, List unwanted referrals). Google says matching events then carry ignore_referrer=true and the referrer isn’t shown as a source. It’s the same step as for a payment gateway.
Then switch off the second count
Once your page counts the booking, the provider’s own integration into the same property double counts it and keeps adding new visitors from your own domain. Disconnect it, send it to a separate property, or at least don’t mark its events as key events. Calendly allows one GA4 Measurement ID per organisation, so this is an organisation-wide choice there.
Adding your own domain to the unwanted-referrals list hides the referral row. It doesn’t join the two visitors or bring back the campaign. Only counting on your page does that.
One case where you can pass the visitor in: if you build the page inside the iframe yourself, Google’s manual cross-domain method applies. Read the client ID and session ID with gtag’s get on your page, pass them into the frame, and give them to config there. That is developer work and has to be tested on every route. For a third-party widget you can’t edit, use Route 1 or 2.
What about UTM tags in the embed code?
Calendly suggests adding UTM parameters to the scheduling link in the embed code, and Typeform has tracking and transitiveSearchParams options that pass parameters from your page into the form. That labels the widget’s own events with a campaign. It’s useful if the provider’s integration is all you have. But it’s a label you choose when you write the embed, not the click that brought this visitor, and it doesn’t stop the new-visitor count. Counting on your own page doesn’t need it.
Does consent change any of this?
Two banners can be in play. Calendly’s help page says visitors in regions with strict privacy laws see a Calendly cookie banner, and if they reject cookies some activity may not be tracked. Counting on your page means one consent decision governs the booking event: your own banner and Consent Mode setup, which is also what Google Ads modelling works from. That’s one less place for bookings to go missing.
How do I know it’s fixed?
- Make a test booking with GTM Preview open. You should see
booking_completeon your page, then the GA4 event tag fire. Preview follows your page, which is where the event now lives. - In GA4 DebugView, the booking event sits in the same session as your page views, with no new
session_startat the moment of booking. - After a week, the exploration above shows no booking events under the provider’s hostname, and bookings sit under the channels that drove them.
Who fixes this?
Whoever manages your Google Tag Manager container: one listener, one event tag, one switch turned off in the booking tool. If nobody does, it’s the kind of job I take on under Google Tag Manager consulting. It matters most when the booking is the conversion you bid on in Google Ads, because the ad click lives in your page’s session.
Filed as SYM-069 under F-205 . The bookings are real; only their credit is wrong.
Common questions
Why do bookings from my embedded Calendly show as direct in GA4?
Calendly’s own GA4 integration sends its events from inside the widget, on Calendly’s domain, not from your page. Calendly’s help page says that without UTM tags on the scheduling link, GA will show the source as (direct). The visitor’s real source stays with your page’s session, which never sees the booking.
Why does my own website show as a referral next to form submissions?
The form’s tag runs inside an iframe on another domain. The browser gives that iframe your page as its referrer, and the iframe has its own cookies, so GA4 starts a new visitor whose source is your site. The submission is real; its credit has moved from the campaign to your own domain.
Can GA4 cross-domain measurement fix an iframe?
Not on its own. Google’s cross-domain pages describe the linker decorating links when they are clicked, and forms when decorate_forms is set. They don’t cover an iframe’s address. Count the conversion on your own page instead, or, if you control the code inside the iframe, pass the IDs in by hand.
How do I track an embedded booking or form in GA4 with GTM?
Use the tool’s JavaScript embed, which posts a message to your page when the booking or submission completes. Listen for it on your page, check it came from the tool’s origin, push an event to the dataLayer, and fire your GA4 event tag on it. The event then belongs to the visitor’s own session and source.
Should I keep the booking tool’s own GA4 integration switched on?
Not into the same property, once your page counts the booking. Its events arrive as separate visitors from your own domain or (direct) and inflate users and sessions. If you keep it for funnel steps, send it to a separate property, or at least don’t mark its events as key events.
Will fixing this repair past bookings in GA4?
No. Bookings already recorded keep the source they were given. Note the date of the change so month-on-month comparisons read correctly.
Sources
Read on 12 November 2026:
- Google for Developers, measure activity across multiple domains (the linker listens for clicks on links to destination domains; parameters expire after two minutes; forms need
decorate_forms; no mention of iframes) - Google Analytics Help, set up cross-domain measurement (linker depends on user-initiated clicks; manual setup with
getandconfig; no mention of iframes) - Google Analytics Help, identify unwanted referrals (matching events get
ignore_referrer=true; up to 50 per stream) - Google Analytics Help, GA4 dimensions and metrics (Hostname: the subdomain and domain of the URL visited)
- MDN Web Docs, third-party cookies (iframe content from other sites is third-party; Safari and Firefox defaults; Chrome doesn’t block by default; page modified 15 June 2026)
- MDN Web Docs, Document.referrer (inside a cross-origin iframe the referrer is the parent’s origin by default)
- MDN Web Docs, Window.postMessage (always verify
originon the receiver; give an exact target origin when sending) - Calendly Developer, notifying the parent window (events posted with
window.postMessage(), includingcalendly.event_scheduled) - Calendly Help, advanced embed for developers (plain iframes don’t support event tracking via postMessage; origin check against
https://calendly.com) - Calendly Help, Calendly and Google Analytics (updated 20 August 2026: one Measurement ID per organisation; without UTM tags the source shows as (direct); no direct GTM integration)
- Calendly Help, track embed activity in Google Analytics (updated 24 August 2026: UTM parameters in the embed code; Calendly cookie banner in some regions)
- Typeform Developers, embed configuration (
shareGaInstance,tracking,transitiveSearchParams,redirectTargetdefaulting to_parent; the embed is an iframe) and callbacks (onSubmitafter a successful submission) - HubSpot Developers, global form events (
hs-form-event:on-submission:success; updated forms editor only)