Form submit tracking in Google Tag Manager

Igor Ivitskiy

Igor Ivitskiy

  • #6 in The Top 50 Most Influential PPC Experts
About the author ↓

Updated 12 min read

In this article
  1. Track form submit in GTM with a Thank You page
  2. How to track a form submit in Google Tag Manager
  3. What I count as a real form submit
  4. Mark the inquiry, not every form
  5. Non-standard cases
  6. Takeaways on form submit tracking
  7. Checklist: form tracking in 15 minutes
  8. When this does not apply
  9. Questions and answers
  10. Does Analytics already track the form?
  11. Why did the Form Submission trigger miss my form?
  12. Should I star form_submit?
  13. When will the lead show in Google Ads?
In short: Count a finished inquiry, not a press of the button. A thank-you page, the Form Submission trigger, and a data layer event are the three paths that hold up. Mark that event as a key event in Analytics, then import it into Google Ads if you want bids to follow it.

Form submit tracking in Google Tag Manager records a finished inquiry. A visitor who presses Request a quote has not sent the form yet. For a plumber, an HVAC company, or a dentist, that finished form is the lead. The dollar value of the lead is what the ads should learn from.

Form submission in Google Tag Manager uses one of three paths. A thank-you page, when success opens a URL you do not use for anything else. The Form Submission trigger, when the browser really submits the form. A named event in the data layer, when the page stays where it is. You then mark that one event as a key event and, if the accounts are linked, import it into Google Ads. If the container is not on the site yet, start with how to set up Google Tag Manager. The property those events land in is covered in how to use Google Analytics 4.

Form submit tracking in Google Tag Manager
Native submit
Use the Form Submission trigger when a real submit event occurs.
Check: successful native submission.
Ajax form
Push a named event to dataLayer when the page does not reload.
Check: success callback.
Validation
Count the confirmed result, not the button click.
Check: success state in Preview.
Source: Google Tag Manager Help and first-hand evidence.
How native and Ajax form submits are captured in GTM

Track form submit in GTM with a Thank You page

The cleanest count is a page that exists only after a successful form. You are not listening to the form. You are counting that this URL loaded. Google’s page view trigger fires as soon as the browser starts to load the page. A link in the menu, a bookmark, or a second visit will count again. I use this path only when that URL is unreachable any other way.

  1. Do not mark the page_view event itself as a key event. It fires on every page, so every visit would look like a lead.
  2. In Tag Manager, create a trigger. Choose Page View. Under This trigger fires on, choose Some Events. Set Page Path contains the thank-you path, for example /thank-you.
  3. Create a tag of type Google Analytics: GA4 Event. Enter the Measurement ID. For a lead, the event name I use is generate_lead. If you also send a dollar value, set currency to USD. A value without a currency does not feed the revenue metric.
  4. Open Preview, load the thank-you URL, and confirm the tag fired. Load the contact page and confirm it did not.

The tag fields and the Preview button are in Google’s steps for a GA4 event in Tag Manager. If that Google tag is not in the container yet, use how to install Google Analytics 4 with Tag Manager.

How to track a form submit in Google Tag Manager

A classic form lets the browser submit, then reloads or moves on. That is the Form Submission trigger. Ajax, where the page stays put, is the next section.

What I count as a real form submit

I do not count the button. After 19 years of running ads for owners, I count the signal we agreed means the business received the data. A validation error stays out.

The form submission trigger fires on a successful send only when Check Validation is on. Off, and every attempt counts. Wait for Tags holds the submit until the tag fires or the timeout you set runs out. Without it, a slow tag can miss the next page. Choose Some Forms, and filter by the page or by Form ID. When it fires, the trigger fills Form Element, Form Classes, Form ID, Form Target, Form URL, and Form Text.

PathUse it whenWhat has to be true
Thank-you pageSuccess opens a URL used for nothing elseA Page View trigger on that path, and the URL cannot be opened on its own
Native submitThe browser sends the form and loads the next pageCheck Validation is on, and the filter matches that form only
Overridden submitThe page stays, and script cancels the normal submitA data layer event pushed only after the form is accepted
Success messageYou cannot change the form codeThe message is absent until success, then becomes visible
  1. Open Variables, then Built-In Variables, then Configure. Turn on Form ID and Page URL.
  2. Open Triggers, then New, then Form Submission. Turn Check Validation on. Turn Wait for Tags on if the next page loads. Choose Some Forms. Filter with Page URL or Form ID so the other form does not match. To find the form’s ID, right-click the form on your site and choose Inspect, or submit the form once in Tag Manager Preview and check the Form ID variable on the Form Submit event.
  3. Open Tags, then New, then Google Analytics: GA4 Event. Enter the Measurement ID. Use generate_lead only for the inquiry you will bid on, not for a newsletter. If you send value, set currency to USD and set value to what that job is worth to you.
  4. Preview one valid submit and one failed submit. The tag should fire once. Realtime lists Event count by Event name for the last 30 minutes.
  5. Click Submit, choose Publish and Create Version, then Publish. A container you only saved does not change the live site.

Mark the inquiry, not every form

Analytics can already send form_submit on a submit and form_start on the first touch in that session. The switch is Enhanced measurement on the web stream, and it needs no code. form_id, form_name, form_destination, and form_submit_text show in reports only after you create a custom dimension for each.

Do not star form_submit if a newsletter uses that name too. A key event is the event name. Google’s walkthrough for a lead form copies form_submit into a narrower event.

  1. In Admin, under Data display, click Events. You need Marketer access or higher.
  2. Click Create event. Name it lead_form_submit. Set event_name equals form_submit, and form_name equals the name attribute of the quote form. The help example is lead-form.
  3. To mark it before data arrives, open Key events, click New key event, type lead_form_submit, and save. Or click the star in Recent events once the name appears.
  4. A standard property allows 30 key events. Analytics 360 allows 50. The star does not rewrite old days. Standard reports can take up to 24 hours. Realtime can show the key event within a few minutes.

The star and the cap of 30 are on the page for marking key events. A key event is an action that matters to the business. A conversion is what you hand to Google Ads for bidding, and that handoff needs a linked Ads account.

Link the accounts and turn on auto-tagging first. The click id on the ad URL has to survive redirects, or Ads cannot tie the form to the click. Linking is covered in how to link Google Ads and Analytics. In Google Ads open Goals, then Summary, then Create conversion action, and choose the property and the event. A conversion created in Analytics, under Advertising and Conversion management, is secondary. Bidding skips it until you change action optimization in Google Ads. Earlier days are not imported. Ads can take up to 24 hours to show the new conversions. Ads dates the click. Analytics dates the form. One counts once per click. Every counts each form.

Non-standard cases

On many owner sites the form hides, the URL stays, and a line says we will call you. The Form Submission trigger misses that when script has overridden the browser submit. The custom event trigger is the documented path. Push a data layer event only after the form is accepted, for example dataLayer.push({'event': 'generate_lead'}). The name dataLayer is case sensitive. Keep one data layer. Do not replace window.dataLayer with a new list after the container has loaded.

In Tag Manager, choose Custom Event and type the same event name you pushed. Attach the GA4 Event tag from the native path. If you cannot change the site code, use an element visibility trigger on the success message. Pick its id, or a CSS selector. Turn on Observe DOM changes so a message inserted after the click is seen. By default the element must be at least 50 percent on screen. Choose Once per page unless you want every repeat appearance. The visibility trigger also runs when the page loads. If the message is already visible before anyone submits, the tag fires too early.

Takeaways on form submit tracking

Form submit tracking uses a different event name for a quote request than for a newsletter signup, and landing pages for distinct readers can send separate events. A quote request and a newsletter signup do not share one event name. When the landing page splits an emergency plumber from a how-to reader, I send a separate event from that page.

Checklist: form tracking in 15 minutes

Form submit tracking in Google Tag Manager means defining the success path, sending a GA4 event, testing submits in Realtime, publishing the container, then importing the event into Google Ads.

  1. Decide the path: thank-you URL, native submit, data layer event, or a success message that appears only after acceptance.
  2. Build the trigger so a failed attempt and a second form on the site do not match.
  3. Send a Google Analytics: GA4 Event with your Measurement ID and one event name for that inquiry.
  4. Preview a valid submit and a failed submit. Check Realtime.
  5. Submit and publish the container.
  6. Create a narrow event if form_submit covers more than this form, then mark that name as a key event.
  7. Import it into Google Ads and set the action so bidding can use it. Allow up to 24 hours.

When this does not apply

Skip the thank-you path when that URL opens without the form. A menu link or a reload fires the Page View trigger. Skip the Form Submission trigger when script has cancelled the browser submit and the page never reloads. Skip element visibility when the thank-you line is already on screen, or when 50 percent of it never enters the screen.

Do not star form_submit or generate_lead when a newsletter uses the same name. The star cannot see the form id, so you would bid on the cheap signup. A secondary import does not bid, and Ads will not show leads from the days before the import. A container you saved and did not publish changes nothing for a visitor.

The steps for this form are on this page. The step-by-step version of Google Ads for a business owner is in my book on Google Ads for business owners.

Want the system, not scattered tips?

My e-book “19 Google Ads Secrets”: how to get the most out of Google Ads without draining your budget, drawn from real campaigns and tests.

See the book →

Questions and answers

Does Analytics already track the form?

It can. Form interactions send form_start on the first touch in a session and form_submit on submit. That does not separate a quote from a newsletter. Copy form_submit into a narrower event, then mark that name.

Why did the Form Submission trigger miss my form?

Usually the page stays and script has overridden the browser submit, so the trigger never hears it. Push a data layer event from the success callback, and catch that name with a Custom Event trigger.

Should I star form_submit?

Only when that name means one action you would pay for. If several forms share it, star a copied event such as lead_form_submit with a form_name condition. A standard property allows 30 key events. The mark is not applied to past days.

When will the lead show in Google Ads?

After it is a key event, the accounts are linked, auto-tagging is on, and you have imported it. Ads can take up to 24 hours, and earlier days stay out. A conversion created in Analytics stays secondary until you set it for bidding. Ads dates the click, not the day the form was sent.