FREEFirst project with us? Your landing page design is on the house.See the offer

SEO and AEO

Tracking website forms in GA4 with Tag Manager

Track form submissions in GA4 with Google Tag Manager, step by step: pick the right trigger, send generate_lead once, and test it with a real lead.

By Abdul QuadirUpdated 2026-10-137 min read
TL;DR
  • Fire one generate_lead event, and only after the form has really been accepted.
  • The best signal is a data layer push from your site when the send succeeds, picked up by a Custom Event trigger.
  • With no code access, use the Form Submission trigger with Check Validation on, or an Element Visibility trigger on the success message.
  • Decide what to do with GA4's automatic form_submit event, so nobody reads two numbers as one.
  • Send a real lead, try to break it, then mark the event as a key event.

The short answer

To track a website form in GA4 with Tag Manager, send one generate_lead event when the form has really been accepted. The most reliable route is a data layer push from your site after a successful send, a Custom Event trigger that listens for it, and a GA4 Event tag. If you cannot change the code, use the Form Submission trigger with Check Validation on, or an Element Visibility trigger on the success message.

This post covers that one event in detail. For the wider plan, read Marketing site tracking: a setup you can trust first. It assumes Google Tag Manager and GA4 are already on the site.

Step 1: Find out how your form sends

Open the site, open Tag Manager preview, and send a test. What happens next tells you which method to use.

What you seeUse this signalWatch out for
Message appears, no page load, and you can edit the codeData layer push plus Custom Event triggerPush only after the send succeeds
Message appears, no page load, no code accessElement Visibility on the success messageA message that is present on load but hidden needs testing
Preview shows a Form Submit eventForm Submission trigger, Check Validation onCompare against your inbox
New thank-you page loadsPage View on that URLA reload or the back button can count it again
Form sits in an iframe from another serviceThat service's own success callback or redirectTags on your page cannot see inside the iframe

Pick one signal per form. Two signals for one form is how one lead becomes two.

Step 2: Push an event when the send succeeds

Ask whoever owns the form code to add one line in the success handler, after the server has said yes:

window.dataLayer = window.dataLayer || []; dataLayer.push({'event': 'lead_sent', 'form_name': 'contact'});

Google's data layer guide describes this pattern: push when the action happens, with an event key that Tag Manager can listen for.

Three rules for this line:

  • Place it after success. Not on the button click, and not before the request returns.
  • Name the form, not the person. Google's PII policy does not allow emails or phone numbers in Analytics. Keep values like contact or quote.
  • Use one name across forms. One event with a form_name value is easier to report on than ten separate events.

Step 3: Create the trigger and variable

  1. In Tag Manager, go to Triggers, then New, and choose Custom Event.
  2. Enter lead_sent as the event name, exactly as pushed. The Custom Event guide explains the match. Leave regex off unless you need it, because a broad pattern can match events Tag Manager sends by itself.
  3. Go to Variables, then New, and choose Data Layer Variable.
  4. Set the variable name to form_name and save.

Step 4: Build the GA4 Event tag

  1. Create a new tag and choose Google Analytics: GA4 Event.
  2. Enter your measurement ID, the one that starts with G.
  3. Set the event name to generate_lead. GA4 lists this name for lead capture, such as form submissions, so use it instead of inventing one.
  4. Add one event parameter: form_name, with the variable from step 3 as its value.
  5. Attach the Custom Event trigger, and save.

The same reference lists value and currency for this event, and currency is needed if you set value. Leave them out unless you have a lead value your finance team would accept. A made-up number makes reports look exact when they are not.

No code access? Two fallback triggers

Form Submission trigger. In Google's settings, turn on Check Validation so the trigger fires only when the form is sent successfully, not on every attempt. Use Some Forms and filter by Form ID, so a search box or newsletter field does not count as a lead. Wait for Tags holds the submit briefly, so a slow tag has time to fire. Remember this view comes from the browser, so still compare it with your inbox.

Element Visibility trigger. This fires when an element enters the viewport. Point it at the success message:

  • Choose ID or CSS Selector, and keep the selector narrow.
  • Set the firing frequency to once per page.
  • Turn on Observe DOM changes if the message is added after the page loads. Narrow selectors matter here, since watching many elements can slow the page.

A success message below the fold on a phone may never reach the viewport, so test it at phone width. If your success text can appear for other reasons, this trigger will count those too.

Step 5: Decide what to do with form_submit

GA4's enhanced measurement can send its own form_start and form_submit events, with values such as form_id. It is a separate number from your generate_lead, and the two will not always agree.

Our rule is simple. Report leads from generate_lead only. If form_submit is noisy or confuses people, turn it off: in Admin, open Data streams, your stream, the Enhanced measurement settings, then switch off Form interactions.

Step 6: Multi-step and gated forms

A multi-step form needs one more decision: which step is the lead? Fire generate_lead on the final, accepted step only. If you want to see where people drop off, send a separate event such as form_step with a step number, and do not mark it as a key event.

Gated content needs its own form_name. On ClanX we built a custom multi-step talent form and reports behind a form gate, where the PDF comes only after the form. Those are different intents, so a report download should not sit in the same number as a talent application. Use a form_name for each, and decide per form what counts as a lead.

Step 7: Test it, and try to break it

Use a test email you can spot later, and keep Tag Manager preview open. If your tags wait for consent, accept first: DebugView shows nothing when Analytics consent is denied. Consent rules differ by country, and this is not legal advice.

TestExpected result
Send a valid formOne generate_lead in DebugView, one lead in your inbox or CRM
Send with a required field emptyNo event, no lead
Send a bad email addressNo event, no lead
Reload after successNo second event
Double click the buttonOne event, one lead
Use the search box or newsletter fieldNo generate_lead
Check the parametersRight form_name, no personal data
Repeat at phone widthSame results

Then publish the container and run the first test once more on the live site, because preview only covers your draft.

On our own site, generate_lead fires only after a short check that the form is showing its sent state. It is a small guard, and it stops a failed attempt being counted as a lead.

Step 8: Mark it and report on it

  1. Wait for the event to show up in GA4, then go to Admin, Data display, Events, and click the star next to generate_lead. Google says standard reports can take up to 24 hours to show it, and old data does not change.
  2. Create a custom dimension for form_name, so you can split leads by form. Allow 24 to 48 hours before it can be used.
  3. Once a month, compare GA4's count with your inbox. Your inbox is the true count, and GA4 is for spotting patterns.

What to do next

Send one test lead today and count what arrives in GA4. If you see two events or none, start again at step 1. When the forms are right, the next job is measuring calls that get booked.

If you would rather hand this over, our analytics and tracking work starts from $500 and covers GA4, Tag Manager and conversion events. Or send us your site and tell us which form you trust least.

Abdul Quadir
Abdul QuadirFounder of Kookies. Builds Webflow and Astro sites for startups and growing teams.

Terms used: Google Tag Manager, Core Web Vitals

FAQs

Questions
people ask.

Abdul Quadir
Still have a question?Ask us directly. We reply within a day.
Book a callPick a timehello@kookies.io

Push a data layer event from your site after the send succeeds, then use a Custom Event trigger and a GA4 Event tag to send generate_lead. It reflects a real success, not a button click.

Often, yes. Try the Form Submission trigger with Check Validation on, or an Element Visibility trigger on the success message. Test both against your inbox before you rely on them.

Test it on your own forms first. It is an automatic event that is separate from a lead reaching you. We report leads from generate_lead and treat form_submit as a side number, or turn it off.

Mark generate_lead. Do not mark form starts, step events or button clicks, because they make results look bigger than they are.

Tags on your page cannot see inside a form hosted by another service. Use that service's own success callback or a redirect to a thank-you page, as its current docs describe.

Some visitors are not measured, for example people who reject analytics or block tags, and they can still send a form. Treat the inbox as the true count and GA4 as a guide to patterns.

Your turn

Let's kook
what you krave.

Hi Kookies, I need a built on . I'd love to launch . Reach me at
or book a callSent. We reply within one working day.