How-to
How to Track Form Submissions in Google Tag Manager (Without Losing Conversions)
Form submissions are usually the most valuable thing you can track, they're leads, signups and contacts. They're also where GTM trips people up the most, because the page often navigates away before the tracking hit is sent. Here's how to track form submissions reliably, and how to dodge the redirect gotcha that quietly loses conversions.
Three ways to track a form submission
There isn't one "form" in tracking terms, there are several mechanisms, and the right one depends on how your form is built. In rough order of reliability:
- A dataLayer event from your code: the most reliable. Your form's success handler pushes
generate_lead(or similar) only when the submission truly succeeds. - GTM's built-in Form Submit trigger: no code, but it listens to the browser's native submit and can miss JavaScript-driven or embedded forms.
- A success-page or thank-you-page view: fire on the confirmation URL. Simple, but only works if there is a distinct page.
Method 1: GTM's built-in Form Submit trigger
The fastest path when your form does a normal HTML submit. Set it up like this:
- In GTM, go to Variables → Configure and enable the built-in Form variables (Form ID, Form Classes, Form URL).
- Create a trigger of type Form Submission. Tick Wait for Tags and Check Validation so it only fires on genuinely valid submits.
- Scope it: fire on Some Forms where
Form ID equals contact-form(or a class/URL condition) so you don't track every form on the site. - Attach a GA4 event tag that sends a
generate_leadevent.
Why Check Validation matters
The redirect gotcha (and why your tag "doesn't fire")
Here's the classic failure. The form submits, the browser immediately starts loading the next page, and the page unloads before the analytics request leaves the browser. Your tag technically fired, but the hit never made it. In Tag Assistant it can even look fine on a slow connection and fail on a fast one, which is maddening.
The two robust fixes:
- Use Wait for Tags. The Form Submission trigger can delay navigation for a short timeout (e.g. 2000ms) so tags have time to send. Pair it with Check Validation.
- Better: push a dataLayer event on success (Method 2). Modern GA4 uses
sendBeacon, which survives page unload, so a hit fired from a real success event is far more dependable than racing the navigation.
Method 2: the reliable dataLayer approach
For embedded forms (React, AJAX, third-party widgets) the native trigger often never sees the submit. The bullet-proof pattern is to have the form's own success callback announce the event:
// In your form's success handler, fires only when the lead is really captured.
function onContactSuccess(response) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: "generate_lead",
form_id: "contact-form",
form_destination: "/thank-you",
lead_value: 50
});
}Then in GTM:
- Create a Custom Event trigger with Event name
generate_lead. - Create Data Layer Variables for
form_idandlead_value. - Attach a GA4 Event tag (Event name
generate_lead) and map those variables as event parameters.
Why this wins
Practice this on a real container
Form tracking is the one everyone gets wrong the first time. Practice the Form Submit trigger, Check Validation, and the navigation gotcha on a live form, with your own container, debugged in Tag Assistant.
Practice form tracking →Sending it to GA4 and Google Ads
GA4
generate_lead is a recommended GA4 event. Send it from a GA4 Event tag, then mark it as a key event (conversion) in the GA4 interface. Include a value and currency if you assign monetary value to leads.
Google Ads
Fire your Google Ads conversion tag on the same Custom Event trigger so the platforms agree on what counts. Pass a stable transaction_id if you have one, so repeat thank-you page loads or back-button revisits don't double-count the lead.
Quick QA checklist
- Does the tag fire only on a successful, valid submission?
- Does the hit actually leave the browser? Check the Network tab, not just "tag fired".
- Is it scoped to the right form, not every form on the site?
- Are you double-counting on thank-you-page reloads? Add a fire-once or stable id.
- Is any PII (email, phone) accidentally riding along in the event? Keep it out of analytics.
Now go practice it
Reading sticks when you do it. These hands-on lessons load your own GTM container and let you debug in Tag Assistant.
Frequently asked questions
How do I track form submissions in Google Tag Manager?
The most reliable method is to push a dataLayer event such as generate_lead from your form's success handler, then fire a GA4 Event tag on a Custom Event trigger matching that event. Alternatively, use GTM's built-in Form Submission trigger with 'Check Validation' enabled, or fire a tag on the thank-you page URL.
Why does my GTM form tag fire but no data reaches GA4?
Usually the redirect gotcha: the page navigates away before the tracking request is sent, so the hit is cancelled. Enable 'Wait for Tags' on the Form Submission trigger, or fire the event from your form's success callback so a sendBeacon hit goes out before unload.
Should I use the Form Submit trigger or a dataLayer event?
Use a dataLayer event when the form is JavaScript-driven, embedded, or third-party (React forms, AJAX, HubSpot, Typeform), because the native trigger often never sees the submit. Use the built-in Form Submission trigger for simple HTML forms when you can't add code.
What is the generate_lead event in GA4?
generate_lead is a recommended GA4 event for when a user submits a lead form. Send it from a GA4 Event tag, optionally with value and currency, then mark it as a key event (conversion) in GA4 so it counts toward your goals.
How do I stop double-counting form conversions?
Fire once per submission and send a stable identifier. Use a fire-once trigger limit, or pass a transaction_id/event_id so repeat thank-you-page loads and back-button revisits are ignored by the vendor.
Related posts
How-to
How to Set Up Google Tag Manager on Shopify (Storefront + Checkout)
Shopify GTM is two jobs, not one: the storefront installs normally, but the sandboxed checkout needs a custom pixel. The full storefront + checkout setup, GA4 mapping and testing.
Read →How-to
How to Set Up GA4 Ecommerce Tracking with Google Tag Manager
GA4 ecommerce is one pattern repeated across a few events. Walk the full funnel in GTM (from the base tag to a deduplicated purchase with revenue) with copy-paste dataLayer examples.
Read →How-to
How to Set Up Google Ads Conversion Tracking with GTM
Google Ads only optimizes toward conversions it can see. The reliable GTM setup (Conversion Linker plus the conversion tag, with value and dedup), and the mistakes that quietly cost you.
Read →About the author

Analytics & Tag Management Consultant
Nathan Gage got his start in marketing through Google Tag Manager. Seeing how tracking customer behavior could turn raw clicks into insight you can actually act on is what pulled him into the field. Since then he has worked both full time and as a consultant with 15 marketing agencies, supporting brands that spend anywhere from a thousand dollars a month to over a million. Along the way he built a multi-touch attribution app, and he created The Happy Tagger so anyone can practice GTM, GA4 and server-side tracking on a real container instead of a production site.