On this page
What this issue is
An iframe is a window that shows another website's page inside yours. Form tools such as HubSpot, Typeform, Jotform and many CRMs offer embed codes that use one. The form, the submit button and the success message all live inside the frame.
Your page (the parent) cannot see inside a frame from another domain. Browsers block it on purpose. So after a visitor submits, three things can go wrong: the success message appears but is hidden because the frame is too short, the message never appears at all, or it appears inside the frame while the rest of your page looks unchanged and gives no sign of success.
- Page loadsEmbed iframe renders
- Visitor submitsLead reaches the provider
- Success messageHidden or not shown in the frame
- Parent page reactsNo redirect, no event
- Conversion tagNever fires
The form submits, but the visitor and the parent page never see the confirmation.
Why it costs you leads or sales
Visitors who see no confirmation assume the form failed. Some submit again, which creates duplicate leads. Others leave and go to a competitor. Your team may also get a lead and still lose the chance to follow up well, because the visitor never saw what happens next.
There is a reporting cost too. If your ad conversion tag depends on a thank-you page or an event on the parent page, it never fires. Google Ads and Meta then see fewer conversions than you really got, and bidding learns from bad data.
Example: 100 real submissions in a week, with the success message and the conversion event both lost to the iframe.
How to check if your site has it
Open the page in a private window
Use a fresh session so cookies and saved form data do not change what you see. Test on desktop and on a phone.
Submit a test lead
Use a clearly marked test name and email. Watch the area where the form was.
Look for a visible confirmation
You should see a thank-you message or be sent to a thank-you page. If the frame just goes blank, stays the same or shows a sliver of text, the issue is present.
Check the frame height
Right-click the form, choose Inspect, and find the iframe element. A fixed height attribute such as height="500" is a common cause when the message is taller or shorter than the form.
Check for a parent-page event
Open the Network tab and your tag debugger (for example Google Tag Manager Preview). After submit, see whether any event or conversion hit fires from the parent page.
How to fix it
Pick the approach your form provider supports. In order of reliability: redirect to a thank-you page, send a message from the frame to the parent, or at minimum let the frame grow so the built-in message is visible.
| Option | What it does | Best when |
|---|---|---|
| Redirect after submit | Sends the visitor to a thank-you page on your site | The provider has a redirect URL setting. Also gives you a clean conversion URL. |
| postMessage to parent | Frame tells your page the form was sent | You want to show your own message or fire a tag without leaving the page |
| Auto-resize frame | Frame height follows its content | You keep the provider's built-in message |
| Replace the iframe with the provider's script embed | Form renders directly in your page | The provider offers it and your theme allows scripts |
window.addEventListener('message', function (event) {
// Only trust your form provider's origin. Replace with the real one.
if (event.origin !== 'https://forms.example-provider.com') return;
// The message shape depends on the provider. Check its docs.
if (event.data && event.data.type === 'form-submitted') {
var frame = document.getElementById('lead-form-frame');
var msg = document.getElementById('form-success');
if (frame) frame.style.display = 'none';
if (msg) msg.style.display = 'block';
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ event: 'lead_form_submitted' });
}
});<iframe id="lead-form-frame" src="https://forms.example-provider.com/your-form" title="Contact form" style="width:100%;min-height:600px;border:0"></iframe>
<div id="form-success" style="display:none" role="status">
Thanks, we have your message and will reply within one working day.
</div>Set a redirect in the form tool
In the provider's form settings, find the option after submit (often called Redirect URL or Thank you page) and point it at a WordPress page.
Add the listener
Paste the script into a Custom HTML block under the embed, or use a header and footer scripts plugin. Give the iframe the id used in the script.
Increase the frame height
In the Custom HTML block, replace a fixed height with min-height, such as min-height:600px.
Edit the section or page
Add the iframe through a Custom Liquid section or the page's HTML view, depending on your theme.
Add the listener
Put the script in the same Custom Liquid section, below the iframe and success message.
Redirect to a page
Create a thank-you page under Online Store, Pages, and use its URL in the provider's redirect setting.
Create a Custom Event trigger
Add a trigger of type Custom Event named lead_form_submitted, matching the dataLayer push in the listener.
Attach your conversion tags
Fire the GA4 event and ad conversion tags on that trigger, and test in Preview mode.
Use an Embed element
Add the iframe and the hidden success div in one Embed element. Add the script in the same element or in Page Settings, Custom Code, before the body tag.
Publish and test
Embeds only run on the published site, so test on the live or staging domain, not the Designer preview.
Set the form's on-submit action
In the form builder settings, choose a redirect URL or a message after submit, so the confirmation does not depend on the frame height.
Check the embed height
If you embed the form in another site, give the iframe enough height for the message, or use the resize script GoHighLevel provides with the embed code.
Use an Embed code element
Add an Embed HTML element and paste the iframe, the success div and the script.
Size the element
Make the element tall enough for the form and the message, then check mobile view separately.
Add a Code Block
Paste the iframe and success div into a Code Block with Display Source off. Code Blocks may need a plan that allows custom code.
Add the script
Put the listener in the same block or in Settings, Advanced, Code Injection, Footer.
Add the listener and markup
Use the snippets above. Always check event.origin against your provider's real domain.
Resize if the provider supports it
Many providers post their content height to the parent. Read it from the message and set iframe.style.height.
Before
- Visitor clicks submit and the frame looks unchanged or cut off
- No thank-you message on your page
- Conversion tag never fires
- Visitor submits again or leaves
After
- Clear thank-you message or thank-you page appears
- Parent page gets a submit signal
- Conversion tag fires once
- Visitor knows what happens next
How to confirm it's fixed
- Submit a test lead on desktop and mobile and see a visible confirmation
- The message is fully readable, not cut off by the frame
- The lead arrives in the inbox or CRM once, with no duplicates
- Your tag debugger shows the conversion event firing on submit
- The event does not fire when the form is submitted with errors
- The thank-you page, if used, loads the full page and not a nested copy of your site
How to prevent it happening again
Embeds change without you touching your site. The provider can update the form's markup, change its message format or alter what it sends to the parent. A theme update can also replace your custom HTML. Retest after any change to the form, the page or the provider settings.
- Prefer a redirect to a thank-you page you control
- Use min-height or an auto-resize script instead of a fixed height
- Keep the listener and markup in one place, with a comment saying which provider it expects
- Retest after provider updates, theme changes and page rebuilds
- Run the journey on a schedule rather than relying on someone remembering to test
How FunnelGuard handles this
FunnelGuard detects this issue today. A robot visitor opens your page, fills in and submits the embedded form, then runs a frame assertion: it looks inside the iframe for the success state and checks the result is actually visible after submit. If it is missing or hidden, the step fails.
A failure is re-checked from a second region before one alert goes out, with a screenshot and a likely cause, by email, Slack, Teams, WhatsApp, webhook or PagerDuty. FunnelGuard also checks the tracking hits sent to ad and analytics platforms and whether test leads reach your inbox and CRM. Test traffic is marked (utm_source=funnelguard, fg_test=1, an fg_test cookie and its own user agent) and it never bypasses CAPTCHAs or bot protection.
The Free plan covers 1 site and 2 journeys with daily checks and no card. Paid plans start at $39/month with a 3-day free trial, and a free read-only website audit is available.
Questions people ask
Why is my embedded form not showing a thank-you message?
The message usually appears inside the iframe, which may be too short to show it, or the provider may not show one at all. Check the iframe's height and the form's after-submit setting. Setting a redirect or a postMessage listener makes the confirmation reliable.
How does a parent page know an iframe form was submitted?
Browsers stop the parent reading a cross-domain frame, so the form provider has to tell it. Most send a message with window.postMessage, which your page receives with a message event listener. Check the provider's docs for the exact message and always verify event.origin.
How do I redirect to a thank-you page after an embedded form submit?
Use the provider's redirect or thank-you URL setting in the form's options. Make sure it redirects the top window, not just the frame, or your page will load nested inside the iframe. If the provider cannot do that, use a postMessage listener and set window.top.location.
Why is my iframe form cut off after clicking submit?
The iframe has a fixed height, and the success message or error text is taller than the space. Use min-height instead, or an auto-resize script from your provider that updates the frame height as content changes. Check mobile too, where text wraps and runs longer.
Why is my conversion not tracked when the form is in an iframe?
Your tag on the parent page cannot see events inside the frame. Unless the provider sends a message or redirects to a thank-you page, there is nothing for the tag to trigger on. Push a dataLayer event from a message listener or track the thank-you page URL.
Is it safe to listen for postMessage from an iframe?
Yes, if you check event.origin against your form provider's exact domain and ignore all other messages. Without that check, any site could send a fake submit message and trigger your conversion tag or success state.
How can I test an embedded form success message automatically?
Run the journey on a schedule with a tool that can enter the iframe, submit a test lead and check the success state. FunnelGuard does this with a frame assertion and alerts you with a screenshot if the message is missing.
Related issues
- CNV-355Iframe height fixed, submit button cut offFix guide
- CNV-357Embedded form loses UTMs (parent params not passed)Fix guide
- CNV-353Embedded form (HubSpot, Typeform, Jotform) doesn't loadFix guide
- CNV-354Iframe blocked by X-Frame-Options/CSPFix guide
- CNV-358Third-party cookies blocked break embed (Safari ITP)Fix guide
- CNV-359Embed provider account suspendedFix guide