Passing Form Submissions into GA through GTM as Events | Community
Skip to main content
jmillionaire
New Participant
July 14, 2021
Question

Passing Form Submissions into GA through GTM as Events

  • July 14, 2021
  • 1 reply
  • 1447 views

I am trying to pass very specific events for "Sales Form Submit" based on MKTO form IDs through GTM into GA for conversion tracking.

 

Does anyone have a nice tutorial or example of how they have done it in the past? I have a decent solution for content form submits, but when it comes to the embedded MKTO forms on our website for inbound sales inquiries, I am seeing a huge overestimation in goal completions in GA and I think its due to the non-ideal setup.

 

@sanfordwhiteman  - I know you can help me! 

 

Attaching a couple images of how a previous digital agency set things up. I am new at the company and looking to clean things up.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
New Participant
July 14, 2021

Wow, that code is totally wrong. 🙂 It’s adding the same event multiple times. And it’s also adding it onSubmit, when it should be onSuccess.

 

Should be like

MktoForms2.whenReady(function(mktoForm){ mktoForm.onSuccess(function(values,thankYouURL){ dataLayer.push({ "event": "mkSubmit", "eventCallback": function () { document.location.href = thankYouURL; } }); return false; }); });

 

jmillionaire
New Participant
July 14, 2021

Thanks for the insight, Sanford. You are a legend.

 

To confirm should I edit the code to look like this in GTM?