Mobile app version of vmapp.org
Login or Join
Megan663

: Can I track form submissions through Google Tag Manager? I want to track form submissions on the website in Google analytics. I was considering to add the following code to the SUBMIT button,

@Megan663

Posted in: #GoogleAnalytics #GoogleTagManager #UniversalAnalytics

I want to track form submissions on the website in Google analytics.
I was considering to add the following code to the SUBMIT button,

<input id=”contact-submit” class=”button” type=”submit” value=”Submit” onClick="ga('send', 'event', { eventCategory: 'requestinfo', eventAction: 'submit', eventLabel: 'undergrad'});">


But can I do all of this through Google tag Manager to improve efficiency?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Megan663

1 Comments

Sorted by latest first Latest Oldest Best

 

@Alves908

There are many ways so it really depends on what you are trying to accomplish. Below are a few options that will work on contact forms and any other type of click action.

1) You can setup a link trigger in GTM with HTML5 data parameter and class or ID

<input id=”contact-submit” class=”button” type=”submit” value=”Submit" data-form="Contact Us" data-whichpage="Home Page">


In GTM, fire on gtm.linkClick and use element ID -> equals -> contact-submit

2) If you have a confirmation page you can setup a dataLayer and use custom dimension to capture the information.

On your confirmation page setup a data layer using PHP or something:

dataLayer.push({
"Form_Name": "Home Page",
"Form_Type": "Contact Us",
"Custom_Dimention_2": "Parameter 2"
});


Then in GA create the custom dimentions and match them up with corresponding fields in GTM

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme