In this article, we will learn how to track conversions with Google Tag Manager. In particular, the action when the user sends his or her contacts details into the contact form or live chat. Usually, the form has a particular class or ID and we will use these attributes as a trigger. If the class and ID are absent, you should ask the programmer to implement one of these elements with the unique name into the source code. I will also explain to you how to view the class and ID of your form and how to implement them without programmer assistance (for WordPress websites only).
Contact Form Submission Tracking with the Google Tag Manager Trigger.
This trigger fires when the form submission has occurred, and transmits the event gtm.formSubmit when the conversion took place. Upon activation of the event gtm.formSubmit it is possible to send the event, for example, into Google Analytics reports.
Step 1. Trigger Creation in GTM
Path: New Trigger ➡ Trigger Type ➡ Form Submission
Step 2. Trigger Configuration
Choose Form ID as trigger activation that fully or partially matches to your attribute name.
How to find the class and ID of your contact form?
Open your contact form and view the source code of the page (developers mode). If you use Google Chrome you should use the right mouse button and select in the drop-down list View Page Source or use the hotkeys ctrl+shift+I. Find the form action. That is how you are able to view ID and class attributes that match your form.
As I have already mentioned, if the ID and class attributes are absent, ask your webmaster for assistance.
How to Add ID and Class for your Contact Form in WordPress CMS?
In case you use WordPress CMS and the popular plugin “Contact Form 7” is installed, it is possible to create a unique class and ID in the shortcode. This method allows you to do everything by yourself without involving a programmer.
Step 3. Tag Creation and Configuration
Path: New Tag ➡ Tag Type: Google Analytics ➡ Track Type: Event.
Fill the fields Action and Category with the text that characterizes your goal as far as these values will be transmitted into Google Analytics in the Events section.
Path: Google Analytics Settings ➡ Tracking ID of your Property Settings.
Choose previously created trigger to make this tag fire.
Step 4. Check Performance
Check the performance of the trigger in GTM in the Preview Mode.
We should make the test submission first.
Step 5. Create a Goal in Google Analytics
In your “View” create a custom goal.
We’ve assigned values for Category and Action fields on step 3 when configured the tag in GTM. Now we can simply copy and paste these values.
Despite the importance of accurately tracking forms, there is no and cannot be a universal solution. But nevertheless, this article discusses a method that will work in most cases. Use it!