Form-submission tracking helps measure enquiries and conversions. Google Tag Manager (GTM) can fire a trigger when a website form is submitted. This guide covers standard HTML forms that are submitted using <form> and submit.

Steps to set up a form-submission trigger

Step 1: Enable form variables in GTM

  1. Sign in to Google Tag Manager and select your website's container.
  2. Open the menu "Variables".
  3. Under "Built-in Variables", click "Configure".
  4. Scroll to the category "Forms" and enable the following variables:
    • Form ID
    • Form Classes
    • Form Element
    • Form Target
    • Form URL

Step 2: Create a form-submission trigger

  1. Open the menu "Triggers" and click "New".
  2. Click the trigger configuration box and select "Form Submission" (form submission).
  3. Enable "Wait for Tags" and leave the setting at 2000 ms (2 seconds), as described here for tracking JavaScript-based forms.
  4. Enable "Check Validation" to check that the submission succeeded.
  5. Choose whether the trigger should fire on "All Forms" (all forms) or "Some Forms" (selected forms only).
  6. If you selected "Some Forms", add conditions such as:
    • Form ID equals contact-form if the form has an ID (id).
    • Form URL contains /thank-you if submission leads to a thank-you page.
    • Form Classes contains lead-form for forms with a specific class (class).

Step 3: Create a tracking tag for Google Analytics or Facebook Pixel

  1. Open the menu "Tags" and click "New".
  2. Choose the tag type, for example:
    • Google Analytics: GA4 Event to send an event to GA4.
    • Facebook Pixel – Lead Event to track leads in Facebook.
  3. Under Triggering, select the trigger you created in the previous step.
  4. Click "Save".

Step 4: Test and publish

  1. Click "Preview" to check that the trigger works correctly.
  2. Complete and submit a form on your website, then check whether the event appears in GTM debug mode.
  3. If the trigger fires correctly, click "Submit" and then "Publish" to apply the change.

What if the trigger does not fire?

Check whether the form uses AJAX. If it does, consider these alternatives:

  • A trigger Click on Submit Button if the button works without reloading the page.
  • Tracking thank-you page loads if a thank-you page exists.
    Check whether the trigger appears in GTM Preview.

Summary: For a standard form, use the "Form Submission"trigger. Otherwise, investigate tracking the submit button or thank-you page. 

Back to top ↑