Friday, April 19, 2019

Tracking Form Submissions

This is to send an event to Google Analytics when the contact form is submitted, with the following data:
  • Event category: Form Submission
  • Event action: Form Submitted
  • Event label: Form ID: [Form ID]
When there are multiple forms on the website and if you want to distinguish between forms, the event label will be replaced with the ID of the form is submitted.

Enable the required variables

Go to the Variables screen and enable the built-in variables called Form Element and Form ID by ticking the checkbox. At least one form variable must be enabled to ensure GTM records form submissions.




Create a trigger

Go to the Triggers screen and create a new trigger called Form Submission, trigger type as Form Submission.


Then you can choose if you want the trigger to fire on all form submissions or specific forms. If you want to fire on specific forms, click on SOme Forms radio button checked, then save the trigger. In the appeared text boxes you can specify conditions.



Create a tag

Create a Universal Analytics tag to fire the event to Google Analytics.
Go to the tags screen and create a tag called GA Form Submission Tag.
Choose the Universal Analytics tag type.
Enter your Google Analytics property ID.
Select Event from the Track Type dropdown menu.
Enter your event category, action and label values as appropriate (remember to use the Form ID variable in the event label).
Finally, attach the created Form Submission trigger to the tag.




Now you can check whether the tag is firing correctly, by submitting the form.