Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Lead event firing when form validation fails: how to fix it

TRK-045High impactCould addBy FunnelGuardPublished Updated
On this page

What this issue is

A lead event such as GA4's generate_lead should record one thing: a person successfully gave you their details. This issue happens when the tag fires on the click of the submit button instead. The click happens before the form checks the fields.

If the visitor leaves the email empty, mistypes it, or skips a required field, the form shows an error and sends nothing. The click already happened, so the event has already gone to GA4, and often to Google Ads, Meta and other platforms that share the same trigger.

What happens on an invalid submit
  1. Visitor fills formEmail field has a typo
  2. Clicks submitClick trigger fires the lead event
  3. Validation failsError message, nothing sent
  4. No lead in CRMBut analytics counts one

The tracking fires at the click, before validation decides whether the lead is real.

Why it costs you leads or sales

The damage is to your data, and through your data, to your spend. Reports show more leads than your CRM holds, so cost per lead looks better than it is. Campaigns that attract people who struggle with the form look like winners.

It is worse when the event is imported as a conversion. Smart bidding in Google Ads and Meta's optimisation learn from conversions. If failed attempts count, the platforms learn from them and can steer budget toward the wrong audiences.

Reported leads vs real leadsExample numbers
Reported leads vs real leads (example)Counted by click trigger: 130 leads; Actually submitted: 88 leads05010013088Counted by click trig…Actually submittedleads

Example: 100 visitors click submit in a week. 30 hit a validation error on the first try and 12 of them give up. Click tracking counts every click, success tracking counts only sent forms.

How to check if your site has it

Test with a deliberately invalid form
  1. Open GTM Preview or GA4 DebugView

    In Google Tag Manager click Preview and enter your page URL. Or enable DebugView in GA4 under Admin > DebugView with the Tag Assistant or a debug extension.

  2. Submit the form with errors

    Leave a required field empty or type an invalid email such as 'test@'. Click submit and confirm the page shows an error.

  3. Look for the lead event

    If generate_lead (or your lead tag) appears in the preview or DebugView, the event fires without validation. It should not appear until a valid submit.

  4. Compare with your inbox or CRM

    Over a week, compare GA4 lead counts with entries in the form tool or CRM. A GA4 count clearly higher than real entries is a strong sign.

  5. Check the trigger typeGoogle Tag Manager

    In GTM open the lead tag and read its trigger. A 'Click' trigger on a button, or a Form Submission trigger with 'Check Validation' off, is the usual cause.

How to fix it

The principle is the same everywhere: fire the event on a success signal, not on the click. Good signals are a redirect to a thank-you page, a success message appearing, or a success event the form pushes to the data layer.

Fix by platform
  1. Replace the click trigger

    Open the lead tag, remove the button Click trigger and create a new one. Use a Form Submission trigger, tick 'Check Validation' and, if the form reloads the page, 'Wait for Tags'.

  2. Or use a thank-you page trigger

    Create a Page View trigger where Page Path equals your thank-you URL. This is the most reliable option when the form redirects.

  3. Or use a success event

    For AJAX forms, ask the developer or form plugin to push an event on success, then trigger on a Custom Event with that name.

  4. Preview and publish

    Test an invalid and a valid submit in Preview, then publish the container.

Fire the event only after a successful responsejavascript
// Wrong: fires before validation
// button.addEventListener('click', () => gtag('event', 'generate_lead'));

form.addEventListener('submit', async (e) => {
  e.preventDefault();
  if (!form.checkValidity()) {
    form.reportValidity();
    return; // no event on invalid input
  }
  const res = await fetch(form.action, { method: 'POST', body: new FormData(form) });
  if (res.ok) {
    gtag('event', 'generate_lead', { form_id: form.id });
  }
});
Trigger setup

Before

  • Trigger: click on the submit button
  • Fires on empty or invalid forms
  • GA4 leads higher than CRM entries

After

  • Trigger: success signal or validated submission
  • Invalid attempts send nothing
  • GA4 leads match CRM entries
Click trigger vs success triggerInteractive
Lead event fires on button click

Click trigger

Leads or data lost

An invalid form still sends a lead event. GA4 and ad platforms count a lead that never reached you.

Toggle the trigger to see what an invalid submit does to your lead count.

How to confirm it's fixed

Confirmation checks
  • Submit with an empty required field: no lead event in GTM Preview or DebugView
  • Submit with an invalid email: no lead event
  • Fix the error and submit validly: exactly one lead event
  • Refresh the thank-you page: no second event (see TRK-046)
  • The test entry appears in your inbox or CRM
  • After a week, GA4 lead count is close to real form entries

How to prevent it happening again

This usually returns when someone rebuilds the form, swaps a plugin or adds a new tag in a hurry. Keep a short rule in your tracking notes: lead events fire on success, never on click.

Prevention habits
  • Include an invalid-submit test in your launch checklist for every new form
  • Review GTM triggers whenever a form tool or theme changes
  • Reconcile GA4 lead counts with CRM entries monthly
  • Use a naming note in GTM such as 'Lead - success only' on the tag
  • Share the success-signal rule with anyone who edits tags

How FunnelGuard handles this

FunnelGuard does not check this yet. Its robot visitor submits your form with valid test data, so an invalid-submit variant is not built. It is a possible future check.

What FunnelGuard does cover nearby: it runs your real lead journey on a schedule, checks that the tracking hits to GA4, Google Ads, Meta and other platforms are sent on a valid submit, and checks that the test lead reaches your inbox and CRM. That helps you spot a lead event that stops firing, but it will not tell you that the event also fires on failed attempts.

Questions people ask

Why is my GA4 lead event firing when the form has errors?

The tag is most likely triggered by a click on the submit button. The click happens before the form validates, so the event is sent even if the form is rejected. Switch the trigger to a success signal such as a thank-you page or a validated form submission.

How do I make GTM fire a tag only when a form is valid?

Use a Form Submission trigger and tick 'Check Validation'. GTM then ignores submissions that the form blocks. If the form is AJAX-based and GTM does not detect it, use a Custom Event pushed to the data layer on success.

Why does GA4 show more leads than my CRM?

Common causes are click-based triggers counting failed attempts, retries firing the event several times, and thank-you page refreshes. Test an invalid submission in DebugView to see whether failed attempts are being counted.

How do I test that my lead event does not fire on invalid input?

Open GTM Preview or GA4 DebugView, then submit the form with an empty required field or a malformed email. If no lead event appears, the setup is correct. Then submit validly and confirm exactly one event.

Does a wrong lead event affect Google Ads and Meta?

Yes, if the event is imported as a conversion or sent to those platforms. Their bidding learns from the conversions you report, so failed attempts can push budget toward audiences that never become leads.

Is a thank-you page trigger better than a form submit trigger?

Usually yes, because the page only loads after a successful submission. Its weakness is that refreshes can fire the event again, so limit it to once per session or per load. See the thank-you page refresh issue for that.

Does FunnelGuard detect lead events firing on invalid submits?

No. FunnelGuard does not check this yet, and it is a possible future check. It does run your real form journey with valid data and verifies tracking hits and lead delivery, so you still need to test invalid input manually.

Does FunnelGuard catch this?

Could add

Not checked yet: could be added to FunnelGuard.

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.