Mailchimp for Wordpress Form Event Listener
How to track Mailchimp for Wordpress Form Submissions with google tag manager
Are you using Mailchimp for the WordPress plugin for lead generation?
then you’ll find the event listener on this page helpful in measuring Mailchimp for WordPress form submissions as conversions.
Tracking Mailchimp For WordPress Form conversions and pushing the data to your analytics or advertising platform is possible and seamless using Google Tag Manager and the Podia event listener script on this page.
To implement this, 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 for the type of Mailchimp For WordPress form event.
[MailchimpFormSuccess] –> fired if the form is submitted successfully
[MailchimpFormSubscribed] –> fired if the form was used to subscribe
[MailchimpFormError] –> fired if the form was submitted with errors
[MailchimpFormUnsubscribed] –> fired if the form is used to unsubscribe
[MailchimpFormStarted] –> fired once the user starts filling in a form (if you need to measure form abandonment)
Also, you can capture the form ID and name by creating the following dataLayer variables with these keys;
[formID] –> returns the form ID
[formName] –> returns the form name
You can fire your marketing tags/pixels on the form or conversion event using the appropriate trigger created for the Mailchimp for WordPress Form.
<script type="text/javascript"> //fired if form is submitted successfully mc4wp.forms.on('success', function(form) { window.dataLayer.push({ "event": "MailchimpFormSuccess", "formID": form.id, "formName": form.name }); }); //fired if form is used to subscribe mc4wp.forms.on('subscribed', function(form) { window.dataLayer.push({ "event": "MailchimpFormSubscribed", "formID": form.id, "formName": form.name }); }); //fired if form is submitted with errors mc4wp.forms.on('error', function(form) { window.dataLayer.push({ "event": "MailchimpFormError", "formID": form.id, "formName": form.name }); }); //fired if form is used to unsubscribe mc4wp.forms.on('unsubscribed', function(form) { window.dataLayer.push({ "event": "MailchimpFormUnsubscribed", "formID": form.id, "formName": form.name }); }); //fired once user starts filling in a form mc4wp.forms.on('started', function(form) { window.dataLayer.push({ "event": "MailchimpFormStarted", "formID": form.id, "formName": form.name }); }); </script>