Skip to content
FunnelGuard

Fix guide by FunnelsGuard

generate_lead firing on page load instead of submit: fix it

TRK-044High impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

generate_lead is a recommended GA4 event. It should be sent once, at the moment someone successfully gives you their details. This issue means it is sent earlier: when the page loads, when the DOM is ready, or when a form is merely shown.

The usual causes are a Google Tag Manager (GTM) tag using the All Pages, Page View or Window Loaded trigger, a gtag('event', 'generate_lead') call pasted into the page body without a listener, or a trigger on a page path that matches the form page and not the thank-you page.

Why it costs you leads or sales

Every visit to the page counts as a lead. Your reports show a great conversion rate while the inbox stays quiet. If the event is marked as a key event and imported into Google Ads, the bidding system learns from fake conversions and sends you more of the traffic that only views the page.

Where the event fires
  1. Ad clickVisitor lands on the form page
  2. Page loadsgenerate_lead fires here
  3. Form submittedOnly some visitors get here
  4. Real lead dataCannot be separated from page views

The lead event is sent at page load, long before any form is submitted. Real leads can no longer be told apart from visits.

Reported vs real leadsExample numbers
Reported vs real leads (example)Reported in GA4: 1,000 leads; Real form submissions: 40 leads03837671,00040Reported in GA4Real form submissionsleads

Example: 1,000 visitors, 40 real submissions. A load-triggered event reports 1,000 leads.

How to check if your site has it

Test it in a few minutes
  1. Open GA4 DebugView

    In GA4 go to Admin > DebugView. Turn on Google Tag Assistant debug mode, or use GTM Preview, and load your form page.

  2. Load the page and do nothing

    Do not touch the form. If generate_lead appears in the DebugView stream, it fires on load.

  3. Submit the form

    Check whether a second generate_lead appears, or none at all. Either shows the trigger is wrong.

  4. Compare with real leads

    In Reports > Engagement > Events, compare generate_lead counts with the number of entries in your CRM or inbox for the same dates. A big gap points to this issue.

How to fix it

The goal is the same everywhere: fire the event only after a successful submission. Pick the trigger that matches how your form behaves.

Fix by platform
  1. Open the generate_lead tag

    In Tags, open your GA4 Event tag with event name generate_lead and look at its Triggering section.

  2. Remove load triggers

    Remove All Pages, Page View, DOM Ready and Window Loaded triggers from this tag.

  3. Add a submit trigger

    Create a Form Submission trigger limited to your form (Page URL or Form ID matches). If the form submits by AJAX and the trigger never fires, use a Custom Event trigger that listens for a dataLayer event your form pushes on success.

  4. Preview and publish

    Test in Preview mode, then publish the container.

Send generate_lead only on a successful submitjavascript
document.querySelector('#lead-form').addEventListener('submit', function (e) {
  e.preventDefault();
  var form = e.target;
  fetch(form.action, { method: 'POST', body: new FormData(form) })
    .then(function (res) {
      if (res.ok) {
        gtag('event', 'generate_lead', { form_id: 'lead-form' });
        form.reset();
      }
    });
});
Trigger before and after

Before

  • Tag trigger: All Pages
  • Fires when the page loads
  • Leads equal page views

After

  • Tag trigger: successful form submission
  • Fires once per real lead
  • Leads match the CRM

How to confirm it's fixed

Confirmation checks
  • Load the form page in DebugView: no generate_lead appears.
  • Scroll, click around and open the form: still nothing.
  • Submit a valid test entry: exactly one generate_lead appears.
  • Submit an invalid form: no event is sent.
  • After a day, GA4 lead counts are close to your CRM entries.

How to prevent it happening again

Prevention habits
  • Never attach conversion tags to All Pages or Window Loaded triggers.
  • Name triggers clearly, for example 'Form success - contact'.
  • Test in GTM Preview before every publish.
  • Re-run the load-and-submit test after theme, plugin or form changes.
  • Compare GA4 leads with CRM leads every month.

How FunnelGuard handles this

FunnelGuard detects this only partly. It runs your lead form journey on a schedule and checks the tracking hits sent at each step. That per-step view means you can see a generate_lead hit and which step it came with. It does not assert trigger timing, so it does not on its own flag that the hit arrived at page load instead of at submit.

To cover the rest by hand, run the DebugView test above after every change: load the page, wait, and confirm nothing fires, then submit and confirm one event. FunnelGuard still helps by confirming that test leads reach your inbox and CRM, so you can compare real submissions against the lead counts in GA4.

Questions people ask

Why is my GA4 generate_lead event firing when the page loads?

The tag is most likely using an All Pages, Page View or Window Loaded trigger in Google Tag Manager, or a gtag call sits in the page without a submit listener. Change the trigger to a form submission or success event.

How do I make generate_lead fire only on form submit?

In GTM, attach the tag to a Form Submission trigger for your form, or to a Custom Event your form pushes to the dataLayer on success. For AJAX forms, send the event only after the server confirms success.

How can I tell if generate_lead fires on page load?

Open GA4 DebugView, load the form page and do nothing. If generate_lead appears, it fires on load. Also compare GA4 lead counts with entries in your CRM.

Does a wrong generate_lead trigger affect Google Ads?

Yes. If generate_lead is a key event imported into Google Ads, false conversions teach bidding to favour page viewers. Fix the trigger, then review which conversions your campaigns optimize for.

Should generate_lead fire on the thank-you page or on submit?

Either works if it is reliable. A thank-you page trigger is simple but counts refreshes and direct visits unless you guard it. A submit success trigger is more accurate when set up correctly.

Will fixing the trigger lower my GA4 conversions?

Yes, usually sharply, because the inflated page-load events disappear. The lower number is the true one, and it should match your CRM.

Can FunnelGuard tell me if generate_lead fires too early?

Only partly. FunnelGuard checks tracking hits per journey step but does not assert trigger timing, so confirm it by hand in DebugView.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: per-step hits; trigger timing not asserted.

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.