Jotform is everywhere: clinics, schools, nonprofits, service businesses that needed a form fast. Every few weeks someone asks me for “the Jotform listener”, expecting the same postMessage trick that works for Calendly and Typeform.
Here’s the honest answer: Jotform’s embedded iframe doesn’t send a reliable “submitted” message to your page. Jotform’s own support team recommends a different approach, and it’s actually more robust: send people to your own thank-you page and track that.
Why iframe listeners don’t work well here
The Jotform embed is an iframe from jotform.com. It posts some messages (mostly about resizing the frame), but nothing you can count on as a confirmed submission across embed types. Hacks that guess from those messages break whenever Jotform changes its embed.
A redirect to your own page is under your control, works with every embed type, and can carry the submission ID with it.
Step 1: Redirect Jotform to your thank-you page
In Jotform: Settings → Thank You Page → Redirect to an external link, and use:
https://yoursite.com/thank-you/?form=jotform&sid={id}
{id} is Jotform’s submission ID; Jotform fills it in for each entry.
Step 2: The listener (on the thank-you page)
<script>
(function () {
var q = new URLSearchParams(location.search);
if (q.get('form') !== 'jotform') return;
var sid = q.get('sid') || '';
var key = 'analyticsrush_jf_' + sid;
try { if (sessionStorage.getItem(key)) return; sessionStorage.setItem(key, '1'); } catch (e) {}
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ event: 'jotform_submit', submission_id: sid });
})();
</script>
The sessionStorage check means a refresh of the thank-you page doesn’t count a second lead.
Set it up in GTM
- Custom HTML tag with the listener, on Page View, limited to the thank-you page.
- Data Layer Variable:
submission_id. - Custom Event trigger:
jotform_submit. - GA4 event tag:
generate_leadwithsubmission_id. Usesubmission_idas the event ID / transaction ID in Google Ads and Meta for deduplication. - Test: submit the Jotform for real and check you land on the thank-you page with
sidin the URL.
Mistakes to avoid
- Counting thank-you page views without the parameter. People bookmark thank-you pages and Google sometimes indexes them. Only count visits that carry
form=jotform. - Leaving the thank-you page indexable. Add
noindexto it. - Several Jotforms, one redirect. Add a form name to the URL (
&name=quote) so you can tell them apart. - Expecting the redirect inside a pop-up. Some lightbox embeds redirect inside the frame. Use the standard embed or set the redirect to open in the parent window.
What I usually see
Nonprofits and clinics often run Jotform with zero tracking because “it’s in an iframe, it can’t be tracked”. It can, with this two-minute redirect, and suddenly the Google Ad Grants account has real conversions to optimise for.
Bottom line
Don’t fight the iframe. Redirect to your own page, pass the submission ID, and count it once.
Want Jotform entries sent server-side to ad platforms with the submission ID for deduplication? AnalyticsRush can route Jotform webhooks through server-side GTM on Stape. Book a tracking audit.