← All Guides

JotForm Conversion Tracking with Google Tag Manager: Track Embedded Form Submissions in GA4 and Google Ads

JotForm embeds run inside an iframe, so GTM cannot see them directly. Learn how to catch JotForm's submission-completed message, push it to the dataLayer, and fire GA4, Google Ads and Meta conversions, plus a thank-you page fallback.

Atiqul Islam
Written by Atiqul Islam

Tracking & analytics specialist. 278+ GTM, GA4 and server-side tracking projects for clients in the US, UK and Australia.

Rather not do this yourself? I set this up for clients every week. Free 15-minute audit, no obligation.

Book a Free Audit

JotForm is easy to build with and hard to track, for one reason: the form runs inside an iframe served from jotform.com. Your website's Google Tag Manager container cannot see anything inside it. No clicks, no fields, no submit.

JotForm does give you two ways out. It posts a message to the parent page when a submission completes, and it can redirect to a URL of your choice. This guide covers both, in order of reliability.

Method 1: Listen for the Submission Message

When a JotForm submission completes, the iframe posts a message to the parent window. The message is a string that starts with submission-completed followed by the form ID. We listen for it and push a dataLayer event.

Step 1: Listener tag

Create a Custom HTML tag named Listener - JotForm Submission firing on All Pages, or only on pages where JotForm is embedded:

<script>
(function () {
  window.addEventListener('message', function (e) {
    if (!e.origin || e.origin.indexOf('jotform') === -1) { return; }
    var data = e.data;
    if (typeof data !== 'string') {
      try { data = JSON.stringify(data); } catch (err) { return; }
    }
    if (data.indexOf('submission-completed') === -1) { return; }

    var parts = data.split(':');
    var formId = parts.length > 1 ? parts[1].replace(/[^0-9]/g, '') : '';

    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push({
      event: 'form_submit_success',
      form_tool: 'jotform',
      form_id: formId
    });
  });
})();
</script>

The origin check ensures only messages from JotForm are accepted. The form ID lets you separate multiple forms.

Step 2: Variables, trigger and tags

Create a Data Layer Variable for form_id and a Custom Event trigger for form_submit_success. Fire your GA4 generate_lead event, your Google Ads conversion tag and your Meta Lead tag on it. Keep a Conversion Linker on All Pages.

Enhanced Conversions are not available through this method, because the email never reaches your page.

Method 2: Thank-You Page Redirect

In JotForm, under Settings, then Thank You Page, choose Redirect to an external link and point it to a thank-you page on your own site. JotForm lets you append field values as URL parameters, for example ?email={email}.

In GTM:

  1. Create a Page View trigger where Page Path equals your thank-you page.
  2. Create a URL variable for the email query parameter.
  3. Fire GA4, Google Ads and Meta tags on the trigger. Use the URL variable in a User-Provided Data variable for Enhanced Conversions.
  4. Add a small Custom HTML tag on the thank-you page that calls history.replaceState to remove the parameters from the address bar after the tags fire.
  5. Add noindex to the thank-you page.

This method gives you Enhanced Conversions at the cost of some exposure of the email in the URL. Many businesses are comfortable with that on their own domain. If you are not, use Method 3.

Method 3: GTM Inside JotForm

JotForm offers a Google Tag Manager integration under Settings, then Integrations. Add your container ID, and GTM loads inside the iframe. Inside that context, the JotForm thank-you page is a normal page view and the form fields are normal inputs, so you can track submission with a Page View trigger and read the email for Enhanced Conversions with a DOM variable before submit.

The downside is that conversions inside the iframe may not carry the Google Ads click identifier from your main site unless cross-domain linking is set up in the Conversion Linker, with both your domain and jotform.com listed. Set that up and test it.

Testing

  1. GTM Preview on the page with the embed. Submit the JotForm.
  2. For Method 1, confirm form_submit_success appears with the form ID. For Method 2, confirm the thank-you page view and the email variable.
  3. Confirm one fire each of GA4, Google Ads and Meta.
  4. Check the Google Ads request in a tag debugger such as the Insighter Debugger extension.
  5. Open the thank-you URL directly. If you used Method 2, you will see it fires. That is the known weakness; keep the page out of search and navigation.

Common Problems

Recommendation

Use Method 1 for most sites. Add Method 2 if you need Enhanced Conversions and are comfortable passing the email through your own thank-you URL. Use Method 3 when the form is the main conversion and you want full control inside the iframe.

Frequently Asked Questions

Why can't I just track the submit button?

The button lives inside JotForm's iframe on jotform.com. Your page's GTM cannot see clicks inside it. The only signals you get are the messages JotForm posts to the parent page and, if you set one, a redirect.

Can I get the lead's email for Enhanced Conversions?

Not from the iframe message. Use JotForm's thank-you redirect with field values passed as URL parameters to your own thank-you page, read them with a URL variable, then clean the URL. Or put GTM inside JotForm itself through its Google Tag Manager integration.

What is the difference between the iframe embed and the JavaScript embed?

Both load the form in an iframe. The JavaScript embed adds a resize script. The message listener in this guide works with both.

Does the submission message fire for multi-page or card forms?

Yes, on final submission. Card forms also post progress messages, which you can ignore.

Can I install GTM inside the JotForm itself?

Yes. JotForm has a Google Tag Manager integration under form Settings, then Integrations. It loads your container inside the iframe, where the thank-you page is a real page view. That is a good option when you need field values for Enhanced Conversions.

Want This Done Right the First Time?

Book a free 15-minute audit call. I'll review your setup, show you what is broken, and tell you exactly what it takes to fix it.

Chat Now