Track ANY Form in Google Analytics in Under 5 Minutes

Tracking form submissions in Google Analytics can be tricky. I’ve seen multiple guides out there, yet there still seems to be a lingering confusion regarding exact troubleshooting methods that apply across the board and are guaranteed to work.

Not to worry, using the steps outlined below, I have yet to encounter a form that I couldn’t track in under 5 minutes.

To get this done efficiently, I have skipped over explaining the “why” for each method. All you have to do is follow along: Answer the following questions in order and follow the proceeding directions.

  1. Have you tried GTM’s generic form tracker?
    1. Yes – Proceed to step #2 below if it didn’t work
    2. No – Proceed to the “Implement GTM Generic Form Tracker” section
  2. When the form is submitted, does the URL redirect?
    1. Yes – Proceed to the “Track URL redirect upon form submission” section
    2. No – Proceed to step #3 below
  3. Does a thank you message or unique html element appear upon form submission?
    1. Yes – Proceed to “Track appearance of unique confirmation text” section
    2. No – Proceed to step #4 below
  4. Have you tried tracking Form Submission Button Clicks?
    1. Yes – Your blog post may be embedded in an iFrame
    2. No – Proceed to the “Track the form submit button click” section below

NOTE: You will need Google Tag Manager for each of the solutions below. If you haven’t already, head over to tagmanager.google.com and sign up for an account. You will need google tag manager for all of these solutions- trust me, it will make your life much easier. For each solution that I propose below, I have created a preconfigured GTM container with the necessary code and settings already in place. All you need to do is import the container into your Tag Manager account (and update according to the specific instructions). If you are unsure how to import a container into GTM, please head over to my Google Tag Manager Recipe article and read the directions under the “How to Import a Container” section.

How to Test if Form Tracking is Working Correctly

  1. In the same Google Chrome browser, navigate to the following in separate tabs:
    1. Your website property in Google Analytics
    2. Your Google Tag Manager workspace
    3. The page on your website that contains the form you would like to track
  2. Click preview in the upper right hand corner of your GTM workspace
  3. Navigate to the browser tab that contains the form you are trying to track. I recommend clearing your page cookies by pressing Ctrl+Shift+r (reloads the window). Fill out the form you want to track and submit it.
  4. Switch to the tab containing your Google Analytics property
    1. Navigate to Real-Time > Events.
    2. You should see a window that looks similar to the image below:
  5. If you implemented form tracking successfully, the submit event will show up in the table (see image below). Be patient, sometimes it takes a few moments for the event to populate.
    Form tracking in google analytics using GTM

Implement GTM Generic Form Tracker

The very first method you should use to track a form is the one that relies on GTM’s standard form submission trigger. This doesn’t work for every form, but I always give it a try because it does work well in most cases. To implement, follow these steps:

  1. Download and import my pre-configured container: Form Tracker: Generic
  2. Update your GA Settings Variable in your GTM workspace by navigating to Variables > GA Settings Variable > Variable Configuration > Edit Variable Configuration >
    1. Change the Tracking ID from UA-00000-00 to match your GA tracking ID. If you don’t know how to get your GA tracking ID, follow the instructions here.
  3. This form trigger should now fire on all forms on your website. Test if form tracking is working correctly
    1. If that didn’t work for you, proceed to #2 in the table of contents above. If you do see the event appear in your Google Analytics, congratulations, you have successfully tracked submissions to your form (don’t forget to publish your GTM container). This solution will track forms on all pages of your website. If you would like the generic form tracker to only fire on specific forms, follow the directions in step #4 below.
  4. If you only want to track forms on a specific page, try the following (Optional):
    1. Navigate to Triggers > Form Submission > Trigger Configuration > This trigger fires on > Enable this trigger when all of these conditions are true
      1. Change (.*) to the page path that contains the form you would like to track.

Track URL redirect upon form submission

If your form redirects to a new URL upon submission, try the following:

  1. Import my preconfigured GTM container: Form Tracker – URL Redirect
  2. In your GTM workspace, navigate to Triggers > Form Submission > Trigger Configuration > This trigger fires on
    1. Change “your-thank-you-page” to the page path that contains the form you would like to track.
  3. Update your GA Settings Variable in your GTM workspace by navigating to Variables > GA Settings Variable > Variable Configuration > Edit Variable Configuration >
    1. Change the Tracking ID from UA-00000-00 to match your GA tracking ID. If you don’t know how to get your GA tracking ID, follow the instructions here.

Track appearance of unique confirmation text

If a unique thank you message or html element appears upon form submission, try the following:

  1. Note: Sometimes you can track when a form is submitted based on an element that appears on the screen. If you see a thank you message or something of the sort, follow the steps below. Here is an example of a thank you message that appears on a form that I use this method to track:
    GTM form tracking
  2. Install the Get Unique CSS Selector plugin for Google Chrome. It will help you find a unique CSS selector for the element.
  3. Fill out the form and click submit.
  4. With the “Get Unique CSS selector” plugin turned on, hover over the thank you message. You should see something like the screenshot below:
    GTM tracking form submissions in google analytics
  5. Right click on the thank you message and select “Copy Unique Selector to Clipboard”
    form tracking instructions
  6. Download and import my preconfigured GTM container – Form Tracker – Unique Element Visibility
  7. Navigate to Triggers > Form Submission > Trigger Configuration > Element Selector
    1. Replace “.copy-your-unique-selector-here” with the unique selector that you just copied to your clipboard.
  8. Update your GA Settings Variable in your GTM workspace by navigating to Variables > GA Settings Variable > Variable Configuration > Edit Variable Configuration >
    1. Change the Tracking ID from UA-00000-00 to match your GA tracking ID. If you don’t know how to get your GA tracking ID, follow the instructions here.

Track the form submit button click

Note: This technically doesn’t track form submissions, just clicks on the button to submit the form. Depending on your needs, that may or may not be an issue. The number of times that a submit button is clicked often does not exactly match up with the number of times a form is successfully submitted. This is because users often click submit after entering data in the wrong format or missing required fields. To make the data as reliable as possible, I set the form submit trigger to only fire once per page per user. To track form submit button clicks, follow these instructions:

  1. Install the Get Unique CSS Selector plugin for Google Chrome. It will help you find a unique CSS selector for the submit button.
  2. With the “Get Unique CSS selector” plugin turned on, hover over the submit button. You should see something like the screenshot below:
  3. Right click on the highlighted submit button and select “Copy Unique Selector to Clipboard”
    form tracking instructions
  4. Download and import my preconfigured GTM container: Form Tracker – Submit Button Click
  5. Navigate to Triggers > All Page-views > Edit Trigger Configuration > This trigger fires on > Fire this trigger when an Event occurs and all of these conditions are true
    1. Change “.your-unique-css-selector-here” to the unique CSS selector that you copied to your clipboard above.
  6. Update your GA Settings Variable in your GTM workspace by navigating to Variables > GA Settings Variable > Variable Configuration > Edit Variable Configuration
    1. Change the Tracking ID from UA-00000-00 to match your GA tracking ID. If you don’t know how to get your GA tracking ID, follow the instructions here.

The above methods for implementing form tracking in Google Analytics cover almost every single form you will come across. The rare exceptions being any form that is embedded in an iframe. I will write a follow up post in the near future explaining how to track such forms. If you have tried the solutions in this post and are still having issues, please feel free to email me or contact me via LinkedIn with any questions.

Adam Roth, Director of Growth and Analysis

About The Author

Adam Roth is a staff writer for Direct Online Marketing. Adam holds a Master of Science degree from the University of Pittsburgh’s Department of Biomedical Informatics. His article contributions focus on scalable analytics for online businesses. Adam enjoys demanding fitness activities such as weight lifting and hiking.

View Adam's full bio.
Get a free, no-obligation consultation with a digital marketing expert