Analytics

Track ANY Form in Google Analytics in Under 5 Minutes (Updated August 2020)

By DOM Team| 8 Min Read | August 26, 2020
LinkedInFacebookTwitter

Editor’s Note: Looking for information on how to do form tracking in Google Analytics? Are you still using the traditional version of the platform – Universal Analytics? You are at risk of losing any of your historical performance data in 2023 if you don’t set up and properly configure Google Analytics 4. Learn how the two platforms compare to each other in this blog post – Google Analytics 4 vs Universal Analytics.

Tracking form submissions in Google Analytics can be tricky. We’ve seen multiple guides out there, yet many people are still confused regarding exact troubleshooting methods that apply across the board and are guaranteed to work.

Using the steps outlined below, we have yet to encounter a form that we couldn’t track in under 5 minutes.

To get this done efficiently, we 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. For each solution below, we 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 our 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. We 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 we always give it a try because it does work well in most cases. To implement, follow these steps:

  1. Download and import our 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 our 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 we 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 our 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, we 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 our 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 to this are forms that are embedded in an iframe.

Want to be able to use your data to make better decisions to help grow your business? Learn more about our expert marketing analytics services here.

To get more information on this topic, contact us today for a free consultation or learn more about our status as a Google Partner Agency before you reach out.

Related Articles

All Blogs
are-you-getting-bad-quality-leads-from-performace-max-dom-blog
By Ryan Norman| 10 Min Read | July 12, 2024

Are You Getting Bad-Quality Leads From Performance Max?

Updated: 07/12/2024 Performance Max campaigns in Google Ads promise to simplify your online advertising efforts…

Read Article right arrow
where-user-experience-meets-conversion-rate-magic-dom-blog
By Ryan Norman| 17 Min Read | June 11, 2024

Where User Experience Meets Conversion Rate Magic

A good website is easy to use and entices you to act. Let’s unpack the…

Read Article right arrow
save-your-universal-analytics-data-before-it-disappears-july-1st-dom-blog
By Ryan Norman| 6 Min Read | June 4, 2024

Save Your Universal Analytics Data Before It Disappears July 1st

Universal Analytics data will be gone July 1st. Are you prepared with a data exporting…

Read Article right arrow