Tracking Form Submits With Google Tag Manager

  • 16 August 2019
  • 4 replies
  • 236 views

I am trying to set up form submission tracking with Google Tag Manager for a page that uses a thank you pop up once the form is submitted, rather than going to a new page. I have found a number of previous forum questions about this, but nothing I can make sense of.

All I need to do is use Google Tag Manager to create an event that fires only when a form is successfully submitted. When I try setting up a trigger with Event Name gtm.formSubmit and Event type is Custom Event and This Trigger Fires on All Custom Events, nothing happens.

Do I need to have a proper tag set up to do this?


4 replies

Userlevel 4

I was working on the same problem for weeks.

What I ended up doing was re-directing to a Thank Page after the form submission. I put a conversion tracking pixel that fires on page view.

I know there is a better way to do it, but Typeform has terrible customer support and no documentation for GTM conversion tracking so this is a temporary fix until I can figure out a more efficient set up.

If you are using the Form Confirmation Dialog with an Unbounce Form, it technically fires a unique pageview for that confirmation dialog, but I don’t use the pageview to create the event. If you have GTM loaded globally for the domain in Unbounce (or just on the page), you can just add a dataLayer push in the Javascripts section of the tools, I create an event like so - then use GTM to handle the event as you desire, don’t have to listen to the form button or form submit event as the Unbounce form only loads this modal upon successful form submission.

<script>
(function(){
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({'event': 'contact-form-submission'});
})();
</script>

image

Can you help me set this up on GTM? I added the script to unbounce but I don’t know what to do on GTM. Do I just create a page view tag to this event? I’m a bit lost.

My forms fire twice when I do it the suggested unbounce way for some reason so I am looking for alternatives.

Create a trigger in GTM with the Custom Event trigger type and the event name ‘contact-form-submission’ if that is what you go with - then you can fire tags such as Google Analytics events and Facebook conversion events etc. using this trigger.

Reply