Quick answer: The most reliable way to track forms is a thank you page: send visitors to a unique URL after they submit, and set up a destination goal in Google Analytics. If your form does not redirect, use Google Tag Manager’s Form Submission trigger, with “Wait for Tags” and “Check Validation” enabled, to fire a Universal Analytics event tag. For AJAX forms that never submit in the normal way, push a custom event to the data layer when the success message appears, and trigger your tag from that. Always test in Tag Manager’s preview mode and the Real-Time report before relying on the numbers.
For most service businesses, a form submission is the most valuable action a visitor can take. Without tracking it, you cannot tell which pages, campaigns or traffic sources produce enquiries. Google Analytics will happily report visitors and page views, but it does not know a form was sent unless you tell it. This guide covers the main methods using Google Tag Manager and Universal Analytics. If you are setting up from scratch, start with our Google Analytics setup guide.
Method 1: Thank you page goals
If your form sends people to a separate page after submission, such as /thank-you/ or /quote-received/, you do not need Tag Manager to track it at all.
- In Google Analytics, go to Admin, then the view’s Goals settings.
- Create a new goal, choose Custom and select Destination.
- Enter the thank you page path, for example
/thank-you/, with “Equals to” or “Begins with” as appropriate. - Optionally add a value and a funnel.
This method is simple and dependable. Make sure the thank you page cannot be reached any other way, so it is not counted when people land on it directly, and exclude it from search engines with a noindex tag. If you have several forms, use a separate thank you page for each, or add a parameter, so you can tell them apart. Our guide to Google Analytics goals covers goal types in more detail.
Method 2: The Form Submission trigger
When a form submits and stays on the same page, or redirects to a page you cannot control, Tag Manager’s Form Submission trigger can detect it.
Step 1: Enable built-in form variables
In your Tag Manager container, go to Variables, click Configure in the Built-In Variables section, and tick the Form variables: Form Element, Form Classes, Form ID, Form Target, Form URL and Form Text. These let you identify which form was submitted.
Step 2: Create the trigger
- Go to Triggers and create a new trigger.
- Choose the Form Submission event (shown as “Form” in the trigger type list).
- Tick Wait for Tags, which gives tags time to fire before the page moves on, with a maximum wait of around 2,000 milliseconds.
- Tick Check Validation, so the trigger only fires if the form actually submits rather than when validation stops it.
- Set the trigger to enable on the pages where your form appears, for example Page URL contains
/contact/. - Set it to fire on the specific form, for example Form ID equals
contact-form, or Page Path equals/contact/if there is only one form on the page.
Step 3: Create the Universal Analytics event tag
- Create a new tag, choose Universal Analytics, and set the Track Type to Event.
- Enter your tracking ID, ideally through a Constant variable so it is easy to reuse.
- Fill in the event fields, for example Category
Form, ActionSubmit, LabelContact formor{{Page Path}}. - Attach the Form Submission trigger you created.
- Save.
Step 4: Create an event goal
In Google Analytics, create a goal of type Event with Category equals Form and Action equals Submit. Now submissions show up in your conversion reports.
When the Form Submission trigger does not work
The trigger listens for the browser’s standard submit event. Some forms prevent that event from bubbling up, or submit through JavaScript in a way Tag Manager does not see. If the trigger never fires in preview mode, even though the form submits, you need method 3.
Method 3: AJAX forms and the data layer
Many modern forms, including most WordPress form plugins in AJAX mode, send data in the background and show a success message without reloading the page. The cleanest way to track these is to push an event into the data layer when the form succeeds.
If you can edit the code
Add a line to the form’s success callback:
dataLayer.push({'event': 'formSubmitted', 'formName': 'Contact'});
Then in Tag Manager:
- Create a Data Layer Variable called
formName. - Create a Custom Event trigger with the event name
formSubmitted. - Create a Universal Analytics event tag using
{{formName}}as the label, fired by that trigger.
If you use a WordPress form plugin
Many form plugins provide JavaScript hooks or settings for this:
- Gravity Forms can redirect to a confirmation page, or in AJAX mode it fires a
gform_confirmation_loadedjQuery event that a small script can use to push to the data layer. - Contact Form 7 has an
on_sent_okoption in its Additional Settings tab, which runs a line of JavaScript after the message is sent. AdataLayer.pushcall there does the job. - Ninja Forms and others offer similar hooks or redirect options.
If none of that is possible, switching the form to redirect to a thank you page is a perfectly good solution. Our guide to WordPress forms compares the main plugins.
Last resort: watching for the success message
As a fallback, you can use a Custom HTML tag with a small script that watches for the success message to appear, then pushes an event. It works, but it is fragile, since it breaks when the message or markup changes.
Testing your form tracking
Never assume tracking works. Test it:
- Preview mode: in Tag Manager, click Preview, then open your site in the same browser. Submit the form and check the debug pane shows your trigger and tag firing.
- Check validation: submit the form with a required field empty. The tag should not fire.
- Real-Time report: in Google Analytics, open Real-Time, then Events or Conversions, and confirm the submission appears.
- Compare with reality: after a week, compare the number of tracked submissions with the emails or entries you received. Some difference is normal, for example from visitors blocking scripts, but big gaps suggest a problem.
Tracking other enquiry routes
Forms are not the only way people contact you. Consider tracking:
- Clicks on phone numbers using a Click trigger on links starting with
tel:. - Clicks on email addresses with links starting with
mailto:. - Live chat starts, if your chat tool supports events.
Together, these give a much fuller picture of which marketing produces enquiries.
Common mistakes
- Firing on every click of the submit button, which counts failed attempts as conversions.
- Not ticking Check Validation, with the same result.
- Thank you pages indexed in search, inflating goal numbers.
- Duplicate tags, where the event fires twice per submission.
- Forgetting to publish the container after testing in preview mode.
FAQ
Is a thank you page better than event tracking?
It is simpler and more reliable, and it gives you a page for conversion tags. Event tracking is useful when a redirect is not possible.
Can I track which page the form was submitted from?
Yes. Use {{Page Path}} as the event label, or look at the goal’s previous page path in Analytics.
Do I need a developer?
Not for thank you pages or the standard Form Submission trigger. AJAX forms may need a small code change.
Know which marketing brings enquiries
Once forms are tracked, every report in Analytics becomes more useful. If you want help setting up tracking that shows what your website and marketing deliver, see how we help businesses know what’s working.