The original post is here. https://nation.marketo.com/t5/Product-Discussions/How-to-track-Marketo-forms-in-Google-Analytics-using-using-API/m-p/305735
Originally we were doing a page refresh with a form submission but working on moving over to leveraging the API to trigger a conversion event on a successful form submission. I found out this past week that the Marketo team, unbeknownst to me, started to end the page refresh and just show a 'thank you' message after form submission. I'm wondering what I need to do to the code below, if anything, to account for this change. I imagine little or nothing since we are interacting with the API but that whole followUpUrl portion has gotten me a little worried.
MktoForms2.loadForm("//app-ab00.marketo.com", "785-UHP-775", 1057);
MktoForms2.whenReady(function(mktoForm) {
mktoForm.onSuccess(function(values, followUpUrl) {
dataLayer.push({
"event": "marketo.success",
"marketo.form_id": form_id,
"marketo.form_values": values,
"marketo.follow_up_url": followUpUrl,
"eventCallback": function () {
document.location.href = followUpUrl;
}
});
return false;
})
});
... View more