Marketo Form Event Listener

Google Tag Manager and the Marketo Form event listener makes it easy to measure Marketo form submission as conversions, both in your analytics tools or advertising platform. With the conversions data, you can enhance your lead generation strategy.

How to track Marketo Form Submissions with google tag manager

Measure Marketo form submissions as conversion in your ads platform and your analytics tools (Google Analytics, Heap, Piwik Pro, Mixpanel, Amplitude, etc.)

To implement the conversion tracking, you’ll need Google Tag Manager and the Marketo form event listener javascript code.

To begin, create a custom HTML tag where you’ll paste the event listener code and fire it on pageview or DOM ready (always recommended).

The next step in this implementation is to create a custom event with the event name of [marketo_form_submission], which gets fired on all Marketo form submissions.

To capture the Marketo form ID, you’ll create a dataLayer variable with the key [formID]

The Last, step is to create your marketing tag/pixels, add the appropriate trigger and the event parameters you need for analysis.

<script type="text/javascript">
var pollFormElementsIntervalId;

function pollFormElements() {
var a = document.querySelectorAll("form[id^='mktoForm_']");
if (a instanceof NodeList) {
clearInterval(pollFormElementsIntervalId);
for (var b = 0; b < a.length; b++) attachEventListener(a[b])
}
}

function attachEventListener(a) {
a.addEventListener("submit", function(b) {
setTimeout(function() {
var c = 0 === a.querySelectorAll(".mktoInvalid").length;
c && window.dataLayer.push({
event: "marketo_form_submission",
formID: a.id
})
}, 100)
})
}
pollFormElementsIntervalId = setInterval(pollFormElements, 500);
</script>

Video of how to use the listener

Related Event Listener

Drip Form

Track your Drip form submission events as conversions using this Drip form event listener, track submission and other form information.
contact form 7 listener

Contact Form 7

Contact Form 7 event listener that helps you measure successful submission in GTM for easy triggering of conversion pixels.

Converflow

Seamlessly measure Convertflow users’ interactions and fire your marketing tags/pixels on conversions using this event listener.

download the google tag manager recipe for tracking Marketo Form Submissions

we make you smarter with data

made with ❤️

The DumbData Team
Before you leave, try out these free tools.
FREE GA4 AUDIT TOOL & UTM AUDIT TOOL