0
votes

I'm trying to use a tag to track form submits on my website using Universal Analytics & Google Tag Manager. I've done this successfully on another website using the standard Form trigger, but it's not firing on this site. I believe the reason is that this form isn't set up the same way. Can anyone help me diagnose the problem & find a solution. Changing the form setup isn't an option because it's an old site & not templatized. So I need to figure out a tag-manager-based solution.

Here is the opening form tag:

<form name="QuotesForm" onsubmit="return false;">

And here is the input element that fires the form submission:

<input class="button" name="submit" onclick="goToUrl( document.QuotesForm )" type="submit" value="">

So, any advice on how to track form submissions in Google Tag Manager? (I should also note that I'm using the updated UI)

1

1 Answers

0
votes

Default form behavior is canceled by "return false". You can use custom script to check form validation and send event to dataLayer if everything is ok and click on submit button happened. Then you can fire event Google Analytics tag using this event in dataLayer.