- 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 see | Use this signal | Watch out for |
|---|---|---|
| Message appears, no page load, and you can edit the code | Data layer push plus Custom Event trigger | Push only after the send succeeds |
| Message appears, no page load, no code access | Element Visibility on the success message | A message that is present on load but hidden needs testing |
| Preview shows a Form Submit event | Form Submission trigger, Check Validation on | Compare against your inbox |
| New thank-you page loads | Page View on that URL | A reload or the back button can count it again |
| Form sits in an iframe from another service | That service's own success callback or redirect | Tags 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
contactorquote. - Use one name across forms. One event with a
form_namevalue is easier to report on than ten separate events.
Step 3: Create the trigger and variable
- In Tag Manager, go to Triggers, then New, and choose Custom Event.
- Enter
lead_sentas 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. - Go to Variables, then New, and choose Data Layer Variable.
- Set the variable name to
form_nameand save.
Step 4: Build the GA4 Event tag
- Create a new tag and choose Google Analytics: GA4 Event.
- Enter your measurement ID, the one that starts with G.
- 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. - Add one event parameter:
form_name, with the variable from step 3 as its value. - 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.
| Test | Expected result |
|---|---|
| Send a valid form | One generate_lead in DebugView, one lead in your inbox or CRM |
| Send with a required field empty | No event, no lead |
| Send a bad email address | No event, no lead |
| Reload after success | No second event |
| Double click the button | One event, one lead |
| Use the search box or newsletter field | No generate_lead |
| Check the parameters | Right form_name, no personal data |
| Repeat at phone width | Same 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
- 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. - Create a custom dimension for
form_name, so you can split leads by form. Allow 24 to 48 hours before it can be used. - 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.
Terms used: Google Tag Manager, Core Web Vitals



