top of page

Comprehensive Guide to Setting Up Form Fill Event Tracking in GA4

form fill event tracking for ga4

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


  1. Go to tagmanager.google.com

  2. Sign in with your Google account

  3. Select your container (or create a new one if you don't have one yet)


Step 2: Create a Form Submission Trigger


  1. In your GTM workspace, click on Triggers in the left sidebar

  2. Click the New button to create a new trigger

  3. Name your trigger (e.g., "Form Submission - Contact Form")

  4. Click on the trigger configuration area to select a trigger type

  5. Choose Form Submission from the available options

  6. 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)

  7. Click Save


Step 3: Create a GA4 Event Tag


  1. In your GTM workspace, click on Tags in the left sidebar

  2. Click the New button to create a new tag

  3. Name your tag (e.g., "GA4 - Form Submission Event")

  4. Click on the tag configuration area

  5. Select Google Analytics: GA4 Event

  6. 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)

  7. 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

  8. Click Save


Step 4: Connect Your Tag to the Trigger


  1. While still in the tag configuration screen (or by editing your existing tag):

  2. Click in the Triggering section at the bottom

  3. Select the form submission trigger you created in Step 2

  4. Click Save


Step 5: Test Your Configuration


  1. Click the Preview button at the top right of the GTM interface

  2. Enter your website URL and click Start

  3. Your website will open in a new tab with the GTM debug panel at the bottom

  4. Navigate to your form and submit it

  5. In the debug panel, check if:

    • Your trigger fired

    • Your tag fired

    • The correct data was collected

  6. If everything looks good, proceed to publishing


Step 6: Publish Your Changes


  1. Return to the GTM interface

  2. Click the Submit button in the top right

  3. Name your version (e.g., "Added form submission tracking")

  4. Add a description if desired

  5. Click Publish


Part 2: Setting Up Google Analytics 4


Step 1: Access Your GA4 Property


  1. Go to analytics.google.com

  2. Sign in with your Google account

  3. Select your GA4 property


Step 2: Verify Your Event Is Being Received


  1. In your GA4 property, navigate to Reports > Realtime

  2. Submit the form on your website

  3. Check if the event appears in the realtime report

  4. If not, wait a few minutes and try again; there can be a slight delay


Step 3: Set Up a Custom Event in GA4


  1. In your GA4 property, go to Configure > Events

  2. Look for your event in the list of automatically collected events

  3. 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:


  1. Go to Configure > Conversions

  2. Click the New conversion event button

  3. Select your form submission event from the list

  4. Click Save

  5. This will now be counted as a conversion in your reports


Step 5: Create a Custom Report (Optional)


  1. Go to Library > Create > Explore

  2. Choose a template (Blank is a good starting point)

  3. Configure your exploration:

    • Add dimensions (e.g., Page path, Device category)

    • Add metrics (e.g., Event count, Event value)

    • Apply segments if needed

  4. Filter for your form submission event

  5. 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:

  1. Create Data Layer variables in GTM for each form field

  2. Add these variables as parameters in your GA4 event tag

  3. Be careful not to track sensitive information (passwords, credit cards, etc.)


Track Form Abandonment:

  1. Create a trigger for form field engagement

  2. Set up a timer trigger that fires after a specific period of inactivity

  3. Create a separate "form_abandonment" event tag


Track Form Errors:

  1. Identify how form errors are displayed on your site

  2. Create a trigger for when error messages appear

  3. 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:


  1. Periodically check your reports to verify form fill event tracking data is still being collected

  2. If your website or forms change, update your GTM configuration

  3. Stay informed about updates to GA4 and GTM that might affect your setup

  4. Review your event parameters to ensure you're capturing the most valuable data

bottom of page