
GA4 Enhanced Measurement
Learn how to set up Google Tag Manager constants to streamline your GA4 and pixel tracking setups.
Are you using a booking widget like GoHighLevel (LeadConnector) on your website?
For any marketing teams using these booking forms there is a recurring headache: tracking those iFrame conversions in Google Analytics 4 (GA4).
Because these widgets load inside an iFrame, they often act like a restricted “black box.”
Fortunately, I’ve come up with a reliable workaround.
Let’s dive into how to track those iFrame conversions in GA4.
The Problem: iFrames prevent standard GTM triggers from seeing user actions because of browser security rules.
The Solution: Use a Custom HTML listener in GTM to “hear” the success signals the iFrame sends to your parent page.
The Benefit: Accurate conversion data in GA4, allowing for better budget allocation and lead attribution.
Expert Tip: Always validate the “Origin” of the message to ensure your data remains secure and clean.
window.addEventListener("message", function(event) {
console.log("Origin:", event.origin);
console.log("Data Payload:", event.data);
});
Now, complete a test booking.
You’ll likely see a lot of background noise in the console (often [iFrameSizer] messages).
Ignore those.
Look for the message that fires exactly when you confirm the booking. For GoHighLevel, the success payload usually looks like an array:
Origin: https://api.leadconnectorhq.com
Data Payload: (2) [‘msgsndr-booking-complete’, {calendarId: ‘GYtco…’}]
Now that we know what the success message looks like, we can tell GTM to listen for it. This script acts as a filter—it ignores the resizing noise and waits specifically for the msgsndr-booking-complete signal.
This looks for the message msgsndr-booking-complete and pushes a dataLayer event called ghl_booking_complete
You can amend the event name if you want.
Next, we need a trigger that fires our GA4 tag only when the ghl_booking_complete event happens in our script.
It’s time to tie it all together. We want to send this data to GA4 using a recommended event name to keep your reporting clean.
Never publish without testing.
Use GTM’s Preview mode and run a final test booking on your site.
You should see the ghl_booking_complete event appear on the left side of the debug timeline.
When you click on that event, your GA4 event tag should show as “Succeeded” or “Fired.”
Tracking cross-domain iFrames can feel like navigating a minefield, but by leveraging postMessage payloads, you can reclaim your data accuracy. If you’re seeing discrepancies in your lead data or want to take your tracking further with server-side tagging, the team at KRM Digital is here to help.
Tracking cross-domain iFrames can feel like navigating a minefield, but by leveraging postMessage payloads, you can reclaim your data accuracy.
Why can’t I just track the “Thank You” page?
Many GoHighLevel widgets don’t redirect to a new URL; they simply show a success message within the same iFrame. If there is no URL change, there is no “Page View” for GTM to trigger on.
Will this slow down my website?
Not noticeably. This script is lightweight and only executes a few lines of code when a message is received. If you are that concerned about tags and triggers slowing down your site, do a tag manager audit any remove any unused scripts.
Do I need to do this for every calendar?
No. Because we are capturing the calendarId dynamically, this single setup will track bookings across all your GoHighLevel calendars and tell you exactly which one was used in your GA4 reports.

Learn how to set up Google Tag Manager constants to streamline your GA4 and pixel tracking setups.

Learn how to set up Google Tag Manager constants to streamline your GA4 and pixel tracking setups.

Learn how to set up Google Tag Manager constants to streamline your GA4 and pixel tracking setups.
A step-by-step guide to setting up highly reliable Mailto and Tel link tracking for your website using Google Tag Manager.
Author
Hello, I'm Kyle Rushton McGregor!
I’m an experienced GA4 Specialist with a demonstrated history of working with Google Tag Manager and Looker Studio. I’m an international speaker who has trained 1000s of people on all things analytics.