Blog

If you want to setup event tracking in Google Analytics to know how visitors are interacting with your forms, this article is for you. Google Tag Manager has a built-in form listener that will fire an event every time a user submits a form.

It’s very easy to setup, and below we’ll show you how, as well as explain how to deal with possible issues.

Setting up form tracking in Google Tag Manager and Google Analytics

First, we’ll need to decide which data we want to store in Google Analytics. See this blog post about custom dimensions and event tracking to see how you can customize this to just the way you like it, but for now we’re going with the approach below:

  • Event category: Form
  • Event action: Submit
  • Event label: {Form ID}

The {Form ID} variable is a built-in one, which you can enable under the Variables submenu in GTM:

Built-in variables
Built-in variables
Form variables in GTM
Form variables in GTM

Select Form ID, so you can use it for your different tags. The Google Analytics event tag looks like this:

Form tracking in GA & GTM
Form tracking in GA & GTM

Now, we only need to add a trigger that fires whenever a form is submitted. For this, you can use the Form submit trigger under User Engagement.

Form submit event GTM
Form submit event GTM

Just select it and link it to your tag and you’re all set.

Form tracking on a specific page

If you want to only track a form submit for a specific page, you can alter the trigger to account for this. There’s several ways to do this, and the best solution will be determined by how your website is setup:

  • If you only want to measure the contact form under /contact, then you should use a page filter
  • If you have a multilingual website with localized URLs, it will be easier to check for the Form ID (the same variable we set up earlier)
  • If you just want to exclude a certain form, based on its styling, then you want to check for Form Classes

Below, you’ll find an example of a combination of these settings:

Form config GTM
Form config in Google Tag Manager