Track Embedded Mailchimp Forms in Google Analytics
A quick tutorial on how to track Mailchimp sign up forms in Google Analytics via Google Tag Manager
A quick tutorial on how I went about tracking Mailchimp forms on a website using Google Tag Manager (GTM). This allowed me to see which pages were generating the most sign ups to a Mailchimp list and would allow me to further optimise designs and placements of the forms to increase sign up rate. Historically you would have had to put event tracking on the submit button but Tag Manager’s Form Submission trigger type means you can now track successful submissions on embedded forms like this one. This trigger type is especially useful for when you don’t have control on what happens after a form is submitted.
1. Get the Mailchimp Form Code
In your Mailchimp account go to Lists > [list name] > Sign Up Forms > Embedded Forms. You will then get a few options as to the way your form will display.
Let’s have a look at (a stripped back version of) Mailchimp’s embed code:
<!-- Begin Mailchimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css">
<style type="text/css">
#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
/* Add your own Mailchimp form style overrides in your site stylesheet or in this style block.
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</style>
<div id="mc_embed_signup">
<form action="https://packtpub.us11.list-manage.com/subscribe/post?u=[USERVALUE]&id=[LISTVALUE]" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<h2>Subscribe</h2>
<div class="indicates-required"><span class="asterisk">*</span> indicates required</div>
<div class="mc-field-group">
<label for="mce-EMAIL">Email Address <span class="asterisk">*</span>
</label>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_693897ba2220b83ddb807103a_c970747b22" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</div>
</form>
</div>
<!--End mc_embed_signup-->
We’re most interested in the