How to Set Up Form Submission Triggers in Google Tag Manager (Step-by-Step Guide)
Table of Contents
- Introduction
- Why You Should Track Form Submissions
- Pre-Requisites Before You Start
- Understanding GTM Form Submission Triggers
- Step-by-Step – How to Set Up a Form Submission Trigger in GTM
- Tracking JavaScript and AJAX-Based Forms in GTM
- Best Practices for Form Tracking in Google Tag Manager
- Troubleshooting Common GTM Form Trigger Issues
- Conclusion
Introduction
Forms are the heart of any website that collects user data. Whether you’re capturing leads, supporting customers, or signing up users, forms help your business grow.
But here’s the problem: how do you know when someone fills out a form?
Google Tag Manager form submission tracking can help with that. Without modifying the code, you may use it to monitor each form submission on your website. No need for developers every time you want to measure form success.
This approach is versatile and seamless thanks to Google Tag Manager (GTM). It allows marketers and business owners to set up form triggers easily, even if they’re not tech experts.
We’ll take you step-by-step through the procedure in this guide. You’ll learn how to create a GTM form submission trigger, test it, and make sure it’s working perfectly.
We’ll also cover how to handle different types of forms, such as AJAX-based forms or those built with JavaScript. These can be tricky, but we’ll show you how to manage them too.
Whether you run a small business, manage a WooCommerce store, or handle SEO for a client — this guide is built for you.
Why You Should Track Form Submissions
Tracking form submissions helps you measure the real value of your website. The number of people who are actually getting in touch with you, registering, or making a request is visible to you.
Here’s why it matters:
- Know what’s working: You can track which forms are being used the most.
- Improve your website: Find out which pages convert best.
- Boost your marketing: See which ads or campaigns drive form submissions.
- Get more leads: Use data to fine-tune your lead generation strategy.
Without tracking, you’re in the dark. You won’t know how well your forms perform or if visitors are even using them.
Using Google Tag Manager form submission tracking, you can:
- Set up tags that fire when someone submits a form.
- Track those actions in tools like Google Analytics.
- Create events to measure success inside your reporting dashboard.
Better yet, you can accomplish all of this without constantly changing the code of your website.
Pre-Requisites Before You Start
Before you start tracking form submissions in Google Tag Manager, a few things must be ready. Skipping these steps can lead to errors or missed data.
You must have the following in place:
- Google Tag Manager Installed on Your Website
First, you need to have GTM properly set up. If it’s not installed yet, you must:
- Sign up at tagmanager.google.com
- Create a new GTM container for your website
- Add the GTM code snippet to your website’s <head> and <body> sections
If you use platforms like WordPress or WooCommerce, you can install GTM using plugins like:
- GTM4WP (Google Tag Manager for WordPress)
- Site Kit by Google
- WooCommerce-specific integration plugins
Double-check that GTM is firing correctly using the Preview or Tag Assistant tool.
- You Must Have an Active Form on Your Website
The second step is having a working form to track. You can’t track what doesn’t exist.
Common examples include:
- Contact forms (e.g., on a Contact Us page)
- Newsletter signup forms
- Support request or quote forms
- Checkout or lead generation forms
Make sure the form is live and functional before setting up the trigger.
- Enable Form Variables in GTM
Google Tag Manager doesn’t track form fields by default. The built-in form variables must be manually enabled.
To do this:
- Go to Variables in your GTM dashboard
- Click on Configure under Built-In Variables
- Check the following:
- Form ID
- Form Classes
- Form Element
- Form Target
- Form URL
These help GTM identify and trigger the correct form submission.
- Optional: Access to Google Analytics
If you plan to link your form submissions to Google Analytics, you’ll need access to that property.
This allows you to:
- Track events like “form_submitted” in GA4
- See how many users submitted forms from which page
- Add conversion tracking for paid campaigns
You don’t need GA right away, but having it ready makes the process smoother.
Understanding GTM Form Submission Triggers
A form submission trigger in Google Tag Manager tells GTM when to fire a tag. It activates when someone submits a form on your website.
GTM offers a built-in trigger type called “Form Submission”. This works well for standard HTML forms. It listens for a submit event and then activates your chosen tag (like sending data to Google Analytics).
But not all forms behave the same.
Some use JavaScript or AJAX and never reload the page. In those cases, GTM might not detect the submission unless you use a custom event.
So, it’s important to understand how your form behaves:
- Standard form? Use the built-in trigger.
- Dynamic/AJAX form? Use a Custom Event trigger.
Step-by-Step – How to Set Up a Form Submission Trigger in GTM
Setting up a GTM form submission trigger is easier than it seems. You will be able to monitor each completed form on your website after it is finished. This section will clearly guide you through each stage.
We’ll cover:
- Enabling form variables
- Creating the trigger
- Testing and debugging
- Connecting the trigger to a Google Analytics event (optional)
Let’s get started.
Step 1: Enable Built-in Form Variables
You must instruct GTM on what to track before you can create any triggers.
By default, GTM doesn’t monitor form details like ID or classes. These details are essential to identify which form was submitted.
Here’s how to enable them:
- Go to your Google Tag Manager dashboard.
- Click on the “Variables” tab from the left menu.
- Under “Built-In Variables”, click “Configure”.
- Check the boxes for all form-related variables:
- Form ID
- Form Classes
- Form Element
- Form Target
- Form URL
These help GTM recognize which form triggered the event.
Once enabled, these variables will be available during testing in Preview Mode.
Step 2: Create the GTM Form Submission Trigger
Now let’s create the actual trigger.
This trigger will “listen” for form submissions and fire a tag when someone fills out the form.
Follow these steps:
- Go to “Triggers” in your GTM dashboard.
- Click the “New” button to create a trigger.
- Name your trigger something simple like: Form Submission – Contact Page.
Trigger Configuration:
- Click “Trigger Configuration”, then select “Form Submission” from the list.
- Under options, check:
- Wait for Tags (recommended)
- Check Validation
These options ensure GTM waits for the form to complete before firing.
Set Trigger Conditions:
Now decide when the trigger should fire. If you want it to fire only for specific forms, add conditions.
Click “Some Forms” and use rules like:
- Form ID equals contact-form
- Page Path contains /contact
- Form URL contains /support-form
These conditions make the trigger fire only when the correct form is submitted.
Click Save when done.
Step 3: Link the Trigger to a Tag
A trigger alone doesn’t track anything. It must be connected to a tag. Let’s make a tag for this tutorial that forwards the event to Google Analytics.
If You’re Using Google Analytics 4 (GA4):
- Go to the “Tags” section in GTM.
- Click “New”, then name the tag: GA4 – Form Submission.
- Under Tag Configuration, choose “Google Analytics: GA4 Event”.
- Select your GA4 Configuration tag from the list.
- For Event Name, enter:
- form_submission
- Optionally, under Event Parameters, add:
- Parameter name: form_name
- Value: {{Form ID}} (or another form variable you enabled)
- Choose the form trigger you previously established in the Triggering section.
Click Save.
This setup will now send a form submission event to GA4 every time the form is filled out.
Step 4: Preview and Debug Using GTM
Before publishing anything, always test your setup.
Here’s how to do it:
- In GTM, click “Preview”.
- Enter your website’s URL and click Connect.
- Navigate to the form page.
- Fill out and submit the form.
After submission, check the Tag Assistant window:
- Did your form submission trigger fire?
- Did your GA4 tag activate?
- Do form variables show correct values?
If yes, everything is working fine.
If no, check the following:
- Is your trigger condition too strict?
- Is the form using AJAX and skipping the standard submit event?
Step 5: Publish Your Changes
Once you confirm that the trigger and tag work:
- Click “Submit” in GTM.
- Add a version name like Form Tracking Live.
- Hit Publish.
Your tracking setup is now live on your website!
Tracking JavaScript and AJAX-Based Forms in GTM
Not all forms behave the same way on websites. Some forms use JavaScript or AJAX to submit data. These forms don’t reload the page or trigger the normal submit event.
As a result, the standard GTM form submission trigger won’t fire.
But don’t worry — you can still track these forms using a Custom Event trigger.
Let’s break this down step by step.
Why GTM Doesn’t Track AJAX Forms Automatically
GTM listens for regular form submission events by default. If the page doesn’t reload after submitting a form, GTM may not detect anything.
AJAX forms use JavaScript to send data in the background. This makes the form submit feel instant, but GTM can’t “see” it without extra help.
Therefore, you will need to track them using a different way.
How to Track AJAX or JavaScript Forms with Custom Events
To track these forms, you can use dataLayer.push() inside your form’s script. This tells GTM that the form was submitted.
Here’s an example code snippet:
<script>
document.querySelector(“#contact-form”).addEventListener(“submit”, function() {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: “formSubmitted”
});
});
</script>
Replace #contact-form with your form’s actual ID or class.
This code pushes a custom event called formSubmitted to the GTM data layer.
Create a Custom Event Trigger in GTM
Establish a trigger after the event has been pushed to the data layer:
- Go to Triggers > New
- Choose Trigger Type: Custom Event
- In the Event Name field, enter:
- formSubmitted
- Set it to fire on All Custom Events or define specific conditions
- Click Save
Now, link this trigger to a tag — like a GA4 event — just like you did with the standard form.
Best Practices for Form Tracking in Google Tag Manager
Once your GTM form submission trigger is set up, it’s important to keep it running smoothly. Errors in tracking can lead to missing valuable data or double-counting form submissions.
To keep your form tracking setup clean and reliable, follow these simple tips:
- Use Clear Naming Conventions
Always use clear and meaningful names for your tags and triggers. This facilitates the management of your GTM account, particularly if several individuals work on it.
For example:
- Trigger: Form Submission – Contact Page
- Tag: GA4 – Form Submission – Contact
- Document Your Setup
Keep a record of which forms are being tracked. Note the trigger type used (standard or custom event), the tag it fires, and the page it’s on.
You can do this in a spreadsheet or documentation tool. This helps avoid confusion later.
- Use “Some Forms” Instead of “All Forms”
If you have multiple forms, don’t let one trigger track everything. Use conditions like:
- Form ID
- Page path
- Form URL
This keeps your tracking accurate and avoids false triggers.
- Regularly Test in Preview Mode
Always test your forms using GTM’s Preview Mode. Do this every time you:
- Add a new form
- Edit a trigger
- Update your website’s layout
Testing ensures your tags and triggers still work correctly.
- Monitor in Google Analytics
Check GA4 to confirm form submission events are being tracked. Use the Realtime → Events report to see if your form submissions are being recorded live.
Troubleshooting Common GTM Form Trigger Issues
Even with a good setup, things can go wrong. Here are some quick fixes.
- Trigger Not Firing?
Check these:
- Is the form a standard HTML form?
- Did you enable all form variables?
- Are your trigger conditions too specific?
Try using “All Forms” temporarily to test if the form is being detected.
- JavaScript or AJAX Forms Not Working?
Use a Custom Event Trigger and dataLayer.push() as shown in Part 4. Standard triggers won’t work on AJAX submissions.
- Tag Fired but No Event in GA?
Double-check your Google Analytics configuration tag. Make sure it’s firing on all pages and linked properly in the event tag.
Conclusion
Tracking form submissions is a common issue for website owners and marketers. Many struggle with getting reliable data from their forms, especially when using modern JavaScript or AJAX-based layouts. If you’re not tracking correctly, you’re likely missing out on real insights and potential leads.
At WooHelpDesk, we help WooCommerce and WordPress site owners solve exactly these kinds of problems. Whether it’s broken form triggers, failed analytics connections, or unclear tracking setups—we fix it.
Need expert help with Google Tag Manager or form tracking on your WooCommerce site? Visit
WooHelpDesk.com — our support team is ready to assist you today. Don’t guess your data. Track it right.

