Skip to content
FunnelGuard

Fix guide by FunnelsGuard

GTM form submission trigger not firing on AJAX forms: fix

TRK-107High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

An AJAX form sends its data to the server in the background with JavaScript. The page does not reload, and the form shows a thank-you message in place. Many form plugins and page builders work this way.

GTM's Form Submission trigger watches for the browser's submit event and the gtm.formSubmit event it creates. AJAX forms often cancel the default submit, or the page script stops the event from reaching GTM. The trigger then never matches. Sometimes it fires even when the form is invalid or the server rejects it, which is a different but related problem.

Where the tracking breaks
  1. Visitor submits formAJAX sends data without a page reload
  2. GTM Form triggerNo gtm.formSubmit event reaches GTM
  3. Conversion tagGA4, Google Ads, Meta never fire
  4. Ad platform reportsLeads show as zero

The form works for the visitor, but the tag never receives a signal.

Why it costs you leads or sales

The leads still arrive, so the form looks fine. But your ad platforms never see the conversion. Smart bidding in Google Ads and Meta's delivery learn from those signals, so they optimise with little or no data. Reports make campaigns look like they fail, and you may cut spend on the ones that work.

Leads in the CRM vs conversions reportedExample numbers
Leads in the CRM vs conversions reported (example)Leads in CRM: 40 leads per week; Conversions in ad platform: 6 leads per week01531406Leads in CRMConversions in ad pla…leads per week

Example: 40 real leads arrive, but only the non-AJAX contact form is tracked, so the ad platform reports 6.

How to check if your site has it

Test the trigger in GTM Preview
  1. Open Tag AssistantGoogle Tag Manager

    In GTM, click Preview and enter your page URL. Keep the page and the Tag Assistant window open.

  2. Submit a test lead

    Fill in the form with test data and send it. Use a clearly fake name and email.

  3. Look for the event

    In the left summary list, check for Form Submission (gtm.formSubmit). If the form shows a success message but no such event appears, your trigger cannot fire.

  4. Check the page for a reload

    Open browser DevTools, go to the Network tab and submit again. A background request (type fetch or xhr) with no page navigation confirms the form uses AJAX.

  5. Check the dataLayer

    In the Console, type dataLayer and press Enter. Look for any event the form plugin pushed on success, such as a custom event name.

How to fix it

The reliable fix is to trigger on the form's success, not on the submit click. Use a custom event from the dataLayer, or the plugin's own event if it provides one. Pick the route for your platform.

Get a success event into GTM
  1. Check your form plugin

    Some plugins push an event on success, and others fire a browser event. Contact Form 7 fires a wpcf7mailsent DOM event. Check your plugin's documentation for its success event name.

  2. Bridge the event to the dataLayer

    Add the snippet below via your theme or a code snippets plugin, or a GTM Custom HTML tag set to All Pages. Then create a Custom Event trigger named form_success.

Push a dataLayer event after a successful AJAX submitjavascript
fetch('/api/lead', { method: 'POST', body: new FormData(form) })
  .then(function (res) {
    if (res.ok) {
      window.dataLayer = window.dataLayer || [];
      window.dataLayer.push({
        event: 'form_success',
        form_id: form.id
      });
    }
  });
Contact Form 7: forward its success event to the dataLayerjavascript
document.addEventListener('wpcf7mailsent', function (e) {
  window.dataLayer = window.dataLayer || [];
  window.dataLayer.push({
    event: 'form_success',
    form_id: e.detail.contactFormId
  });
}, false);

How to confirm it's fixed

Confirmation checks
  • In GTM Preview, a successful test submit shows your custom event once in the summary list.
  • The event does not appear when the form is left empty or fails validation.
  • Your GA4, Google Ads and Meta tags show as Fired on that event.
  • GA4 DebugView or the Network tab shows the matching hit leaving the browser.
  • The test lead also arrives in your inbox or CRM.
  • You published the container, not just previewed it.

How to prevent it happening again

Form plugins, themes and page builders change how forms submit when they update. A trigger that worked last month can stop after a redesign or plugin update.

Habits that keep tracking working
  • Use a success-based custom event, not the click or generic submit.
  • Document the event name your developers or plugin push, so it is not renamed by accident.
  • Re-test form tracking after any form plugin, theme or page builder update.
  • Keep GTM workspace notes on which trigger belongs to which form.
  • Run a scheduled test submission rather than waiting for ad reports to drop.

How FunnelGuard handles this

FunnelGuard detects this today. A robot visitor fills in and submits your real lead form on a schedule, then checks which tracking hits were sent to platforms such as GA4, Google Ads and Meta. If the form submits but the expected conversion hit is missing, the check reports a missing hit.

A failure is re-checked from a second region before one alert goes out, with a screenshot and a likely cause. FunnelGuard does not rewrite your GTM setup, so you still apply the fix above. Test traffic is marked with utm_source=funnelguard and fg_test=1, so you can filter it from reports. The Free plan covers 1 site and 2 journeys with daily checks and no card.

Frequently asked questions

The answers below are also in the FAQ section of this page.

Questions people ask

Why is my GTM form submission trigger not firing?

Most often the form is submitted with AJAX, so the page never does a normal submit and GTM never sees a gtm.formSubmit event. Other causes are Check Validation being on, the form sitting in an iframe, or a trigger condition that no longer matches. Test in GTM Preview to see which event, if any, appears on submit.

How do I track AJAX form submissions in Google Tag Manager?

Make the site push a custom event to the dataLayer when the server confirms success, for example event: 'form_success'. Then create a Custom Event trigger with that name and attach your conversion tags. Publish the container after testing in Preview.

Does the GTM Form Submission trigger work with AJAX forms?

Not reliably. It depends on the browser's standard submit event, which many AJAX forms cancel or handle themselves. Some work if you untick Check Validation, but you risk counting failed submissions.

Why does GTM show the form event in Preview but my conversion is not in Google Ads?

The trigger may fire but the tag may be blocked, paused, or missing the right conversion ID and label. Consent settings can also block the tag on the live site. Check the tag's status in Tag Assistant and the Network tab for the outgoing hit.

Can GTM track a form inside an iframe?

Not from the parent page. GTM on your page cannot see events inside a cross-origin iframe. Use a redirect to a thank-you page, or place tracking inside the iframe's own page if the form provider allows it.

Should I untick Check Validation to make the form trigger fire?

It can make the trigger fire, but it can also count invalid or failed submissions as leads. A custom event pushed only on a confirmed success is safer and more accurate.

How can I tell if my form tracking broke after a plugin update?

Submit a test lead and check whether your conversion hit is sent. Doing it by hand is easy to forget, so a scheduled test is better. FunnelGuard runs your form on a schedule and flags a missing hit.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: missing hit.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.