
This step-by-step guide will walk you through the process of form fill event tracking submissions on your website using Google Tag Manager (GTM) and Google Analytics 4 (GA4).
Prerequisites
Before you begin, make sure you have:
Access to your Google Tag Manager account
Access to your Google Analytics 4 property
Admin permissions for your website
Part 1: Setting Up Google Tag Manager
Step 1: Access Google Tag Manager
Go to tagmanager.google.com
Sign in with your Google account
Select your container (or create a new one if you don't have one yet)
Step 2: Create a Form Submission Trigger
In your GTM workspace, click on Triggers in the left sidebar
Click the New button to create a new trigger
Name your trigger (e.g., "Form Submission - Contact Form")
Click on the trigger configuration area to select a trigger type
Choose Form Submission from the available options
Configure the trigger:
Select either All Forms or Some Forms depending on your needs
If choosing Some Forms, you'll need to specify which forms to track:
Select a condition (e.g., "Form ID equals contactForm")
You can use form ID, class, or other attributes to identify your form
Under "Check Validation," select:
Wait for Tags (recommended) - delays the form submission to ensure your tags fire
Set a timeout (e.g., 2000 milliseconds)
Choose when to fire this trigger:
On Form Submit (captures all form submission attempts)
On Submit and Check Validation (captures only successful submissions)
Click Save
Step 3: Create a GA4 Event Tag
In your GTM workspace, click on Tags in the left sidebar
Click the New button to create a new tag
Name your tag (e.g., "GA4 - Form Submission Event")
Click on the tag configuration area
Select Google Analytics: GA4 Event
Configure the tag:
Enter your Measurement ID (starts with "G-")
For Event Name, enter "form_submission" (or a descriptive name of your choice)
Click on Event Parameters to add additional information:
Click Add Row for each parameter you want to track
Common parameters include:
form_id: {{Element ID}} (captures the form's ID)
form_name: {{Element Name}} (captures the form's name attribute)
page_location: {{Page URL}} (captures the page URL)
Under Advanced Settings:
Set tag firing priority if needed (higher numbers fire first)
Consider adding a tag sequencing option if you need this tag to fire before or after others
Click Save
Step 4: Connect Your Tag to the Trigger
While still in the tag configuration screen (or by editing your existing tag):
Click in the Triggering section at the bottom
Select the form submission trigger you created in Step 2
Click Save
Step 5: Test Your Configuration
Click the Preview button at the top right of the GTM interface
Enter your website URL and click Start
Your website will open in a new tab with the GTM debug panel at the bottom
Navigate to your form and submit it
In the debug panel, check if:
Your trigger fired
Your tag fired
The correct data was collected
If everything looks good, proceed to publishing
Step 6: Publish Your Changes
Return to the GTM interface
Click the Submit button in the top right
Name your version (e.g., "Added form submission tracking")
Add a description if desired
Click Publish
Part 2: Setting Up Google Analytics 4
Step 1: Access Your GA4 Property
Go to analytics.google.com
Sign in with your Google account
Select your GA4 property
Step 2: Verify Your Event Is Being Received
In your GA4 property, navigate to Reports > Realtime
Submit the form on your website
Check if the event appears in the realtime report
If not, wait a few minutes and try again; there can be a slight delay
Step 3: Set Up a Custom Event in GA4
In your GA4 property, go to Configure > Events
Look for your event in the list of automatically collected events
If needed, click Create event to define a custom event
Name your event (use a descriptive name like "Contact Form Submission")
Set the matching conditions (e.g., "Event name equals form_submission")
Add any parameter modifications if needed
Click Create
Step 4: Mark Your Event as a Conversion (Optional)
If this form submission is important for your business goals:
Go to Configure > Conversions
Click the New conversion event button
Select your form submission event from the list
Click Save
This will now be counted as a conversion in your reports
Step 5: Create a Custom Report (Optional)
Go to Library > Create > Explore
Choose a template (Blank is a good starting point)
Configure your exploration:
Add dimensions (e.g., Page path, Device category)
Add metrics (e.g., Event count, Event value)
Apply segments if needed
Filter for your form submission event
Save your exploration for future reference
Troubleshooting
If your form submission tracking isn't working properly, check these common issues:
Form Doesn't Trigger the Event:
Ensure the form uses a standard HTML submission method
For AJAX forms, you may need a different approach (DOM element listeners or custom JavaScript)
Check if form validation is preventing the submission
Event Not Showing in GA4:
Verify your GA4 configuration ID is correct in GTM
Check for any ad blockers or privacy tools that might be blocking analytics
Ensure your website has the GTM container code properly installed
Data Not Being Captured Correctly:
Use the GTM preview mode to see exactly what data is being sent
Check variable definitions to ensure they're pulling the correct values
Verify that your form has the expected attributes (ID, name, etc.)
Advanced Options
Track Form Field Values:
Create Data Layer variables in GTM for each form field
Add these variables as parameters in your GA4 event tag
Be careful not to track sensitive information (passwords, credit cards, etc.)
Track Form Abandonment:
Create a trigger for form field engagement
Set up a timer trigger that fires after a specific period of inactivity
Create a separate "form_abandonment" event tag
Track Form Errors:
Identify how form errors are displayed on your site
Create a trigger for when error messages appear
Set up a "form_error" event tag with details about the errors
Form Fill Event Tracking Regular Maintenance
To ensure your form tracking continues to work properly:
Periodically check your reports to verify form fill event tracking data is still being collected
If your website or forms change, update your GTM configuration
Stay informed about updates to GA4 and GTM that might affect your setup
Review your event parameters to ensure you're capturing the most valuable data
