AnsweredAssumed Answered

How to trigger GTM event on form.onSuccess event?

Question asked by Raj Ruprai on Apr 19, 2018
Latest reply on Apr 20, 2018 by Raj Ruprai

Hi,

We have a need to call the form.onSuccess() event so that it performs the following GTM script to the page. Currently it is not working properly on all forms. What could be the cause?

 

Sample implementation:

<script> MktoForm2.loadForm('host', 'account_id', 'form_id, function(form) {

  form.onSuccess(function(values, followUpUrl) {

dataLayer.push({'event': 'some_event', 'form_id': 1111});

  });

)};</script>

Outcomes