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.
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;
});
});
Thanks for the insight, Sanford. You are a legend.
To confirm should I edit the code to look like this in GTM?