A form submission is often the most valuable action on a lead generation site, and it is also the one most often tracked badly. Inflated counts, missed leads and conversions that fire when a form fails are all common, and they quietly distort your Google Ads and Meta Ads results.
This guide walks through a reliable way to track form submissions with Google Tag Manager and the data layer. You will see when a thank-you page is enough, when an event is better, and how to avoid the mistakes that cause bad data.
Thank-you page or event: which should you use?
There are two main ways to detect a successful submission. The first is a thank-you page: after the form is sent, the visitor lands on a confirmation URL, and a trigger fires when that page loads. The second is an event: the form stays on the same page, and your site signals success by pushing a message into the data layer.
A thank-you page is simple and sturdy, so use it when your form redirects. Its weakness is that people can reload the page, bookmark it or arrive from a link, each of which can create a false conversion. An event is better when the form submits in place, which many modern forms do, because there is no page change to rely on.
What the data layer is and why it helps
The data layer is a structured list of messages your website sends to GTM. Instead of GTM guessing what happened by watching clicks and page elements, your site says it directly: a form was submitted successfully. GTM listens for that message and fires your tags in response.
This matters because guessing is fragile. A click on a submit button does not mean the form passed validation or reached your server. A message sent only after a confirmed success is far more trustworthy. Your developer or form plugin pushes the message; you build the GTM side.
Setting up the event in GTM
Agree an event name with your developer first. Use something readable, such as contact_form_submit, and keep it identical everywhere. Then build the GTM pieces:
- Create a trigger with type Custom Event and event name contact_form_submit.
- Create a GA4 event tag, with the event name generate_lead or a name that matches your reporting plan, and attach the trigger.
- Open Preview mode, submit the form on your site, and confirm the custom event appears in the timeline and the tag fires once.
- In GA4, mark the event as a key event so it can be used for reporting and for importing into Google Ads.
- Create a separate Google Ads conversion tag, or import the GA4 key event, using the same trigger.
Use one trigger for every tag that depends on this action. That keeps your platforms counting the same submission, which makes comparing reports far easier. Remember to publish with a version note, such as Added contact form submit event, so the change is easy to find later.
Fire only after success
The most important rule is that tracking fires after the submission succeeds, not when someone clicks the button. If your form shows an error because an email is invalid or a required field is blank, no conversion should be recorded.
Ask your developer or plugin vendor exactly when the data layer message is pushed. Then test the failure case yourself: submit the form empty, with a bad email and with a blocked spam entry, and check in Preview mode that nothing fires. Many form plugins on WordPress and WooCommerce sites offer a success callback that is suited to this.
Avoiding double fires
Double counting usually has one of a few causes. Check each of these when numbers look too high:
- Both a thank-you page trigger and a custom event trigger are active for the same form.
- The data layer message is pushed twice because the form script runs twice.
- Tags are hard-coded on the site and also present in GTM.
- A Google Ads conversion is imported from GA4 and a separate native conversion tag also counts the same action.
Where counting is a concern, set the Google Ads conversion count to one per click for leads, since one person submitting twice is still one lead. Make sure each conversion action has a clear name so your team can tell them apart.
Keep personal data out of your analytics
Do not send names, email addresses, phone numbers or message text into GA4, the data layer or your ad platforms as event parameters. Google Analytics policies prohibit sending personally identifiable information, and regulations such as state privacy laws make it a liability. Push only non-identifying details, such as the form name, the page location or the service selected.
If you need lead details, keep them in your CRM or email system, not in your analytics. Tie them together with a lead source or a click identifier that does not reveal who the person is. Our analytics services and Tag Manager setup are built around this approach.
Key takeaways
- Use a thank-you page if the form redirects, and a data layer event if it submits in place.
- Fire tags only after confirmed success, never on the button click alone.
- Use one trigger for all tags tied to the same form to avoid mismatched counts.
- Never pass names, emails, phone numbers or message text into analytics.