Website Tracking

Track Forms Without a Thank You Page in GTM

No matter what kind of business you are running, you want to make sure you track all of your leads.

Setting up goal tracking in Google Analytics is the way to get a better understanding of where your leads are coming from. You can get valuable data from this that you can use to optimise your website or marketing channels.

Back in the days, most contact forms had a separate thank you page hosted on a different URL. You could easily track your forms by setting up a goal with this URL.

However, we notice that more and more websites are using a different approach. Instead of a separate thank you page, visitors will stay on the same page. Then, they simply get a notification that their message has been delivered.

A lot of WordPress plugins, like Contact Form 7, are using a similar approach.

In this article, I will give you a step-by-step guide on how you can track these contact forms regardless.


Pre-step: install Google Tag Manager


Now, we are going to use Google Tag Manager (GTM) for this.


If you are not familiar with GTM yet, have a look at our introduction to Google Tag Manager article. We highly recommend to set this up for your website, as it will make tracking a lot easier going forward.


GTM also enables to set up additional tracking, like the one described in this article.


Once you installed GTM you can follow the next steps to track your contact forms.


Step 1: check your website code


Screenshot how to set up form tracking in GTM step 1

Go to the page where your contact form is located. On the button, press right click and click inspect. This will open a side screen if your working in Google Chrome.


Screenshot how to set up form tracking in GTM step 2

Now, you want to copy the part that is behind the class= tag. In this example that would be “gform_button button”.


Step 2: add custom variables to GTM


Next, we will need to add a custom variable to GTM.


Screenshot how to set up form tracking in GTM step 3

Go to the GTM container of your website and go to “Variables” in the left-hand menu.


Then, click configure and find “Click Classes” on the list and m
ake sure “Click Classes” is enabled.


Step 3: Create a trigger in GTM


Go to “Triggers” in the left-hand menu and click New to add a new trigger.


Screenshot how to set up form tracking in GTM step 4

For Trigger Type select Click – All Elements. Then, fire this trigger for some clicks.

Lastly, select Click Classes contains whatever you copied from step 1.



Step 4: Create an Event Tag in GTM


Go to Tags in the left-hand menu.


Screenshot how to set up form tracking in GTM step 5

Select Google Analytics – Universal Analytics as the Tag Type.


Screenshot how to set up form tracking in GTM step 6

Then, select for Event for the Track Type.


Basically, you can fill in anything you think would suit for the Category, Action and Label. We are using “Contact Form” for Category, “Sent” for Action and {{Page Path}} for Label. The latter will push through the URL of the contact form.


For Google Analytics Settings you will need to supply your Google Analytics tracking ID.


Now, for triggering we want to select the trigger that we created in step 3.


That’s it from the GTM end. Make sure you publish your changes and let’s move to Google Analytics to set up the goal!


Step 5: Add a goal in Google Analytics


Go to your goals in the view settings in Google Analytics and create a new goal.


Screenshot how to set up form tracking in Google Analytics step 2

Fill in a goal description (we just simply use “Contact Form”) and select the Event type.


Then, fill in the same details as we are pushing through from GTM. Remember, you don’t necessarily have to fill in all the fields.


Finally, press save. En voila you will be tracking your contact form even without a thank you page. Additionally, make sure you track your phone calls in Google Ads as well!

Author


Avatar

Jeroen Minks

With over 10 years experience in digital marketing, Jeroen helps businesses to get more results out of their online advertising budgets.