Tracking Newsletter Signups with Mailchimp and Google Analytics

by Michael Johnston

Mailchimp LogoIf you run an e-commerce site you probably measure your sales conversion ratio, which is simply the percentage of visitors who end up making a purchase. This crucial bit of  information helps you to determine the cost effectiveness of advertising and the general effectiveness of the site overall. You can’t – or, rather, you should’t – run an e-commerce store without it.

Many site managers begin and end their conversion tracking efforts right there. But looking at just that one metric doesn’t provide complete picture of how well a site is really doing.  Aren’t there other actions users take on your site that you should measure and consider a conversion, such as subscribing to your newsletter or asking to be notified when a product is in stock?

Google AnalyticsOn sites that I manage, I like to know how well I’m doing in every measurable aspect. (Within reason, of course; it’s easy to get carried away and fall victim to analysis paralysis when you have too much information.) When it comes to tracking my total conversion ratio, I always combine sales and newsletter signups before dividing by the number of visitors.

Since I use Google Analytics for tracking web metrics, getting a sales conversion ratio is pretty easy. Most e-commerce packages include integrated Google Analytics support, and if they don’t it’s usually just a simple edit of the site footer to add it.

Tracking newsletter signups is a different matter. I use Mailchimp for managing my newsletters, and there things are a bit more complicated because Mailchimp doesn’t support Google Analytics – at least not yet. I could get around the issue if I could just embed the tracking code in my signup forms, but I’m foiled there because Mailchimp doesn’t yet allow hand edits of form HTML in the same way they do for campaigns.

Fortunately, there’s a way around the problem.

What follows is a fairly simple procedure that will let you to track your newsletter signups as an e-commerce sale in Google Analytics. The prerequisites are obviously that you use both Mailchimp and Google Analytics.  It also assumes you’re using the Mailchimp-hosted list signup forms. (If you’re hosting your own signup form, skip straight to step #6.)

  1. Open your Mailchimp-hosted newsletter signup page in your browser and save the HTML as a new file. Let’s call it signup.html
  2. Open signup.html in your text editor.
  3. Get your site’s Google Analytics tracking code.  You can find your tracking code in Analytics by clicking Analytics Settings, then Edit on your site’s profile, and then one final click on Check Status. (Why Google makes it so difficult to find is beyond me.) Several variants of the Analytics tracking code will be shown. For our purposes, the standard code is just fine.
  4. Insert the tracking code into the file you have open in your editor, just prior to the </body> tag. Save the file.
  5. Upload the file you just saved to your web server. For the sake of clarity, let’s just save it as /signup.html for now. This will be your new mailing list signup form.
  6. Next, create a confirmation Thank You page. For the sake of simplicity, it only need say, “Thank you. Your subscription has been confirmed” for now. (But certainly style it up before you go live). The purpose of this page is twofold: first, it lets the user know their subscription has been confirmed; second, when this page is loaded, it will trigger the Google Analytics script that will transmit the ‘sale’ back to Google so it can be counted. Insert the following code into this new page just before the </body> tag. Be sure to substitute the values that are appropriate for your needs – and don’t forget to insert your Analytics ID (found on Analytics Settings page, immediately adjacent to your site URL.)

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ?
"https://ssl." : "http://www.");

document.write(unescape("%3Cscript src='" + gaJsHost +
"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>

<script type="text/javascript">
  var pageTracker = _gat._getTracker("UA-ANALYTICS-ID");

  pageTracker._trackPageview(); // Track pageview

  pageTracker._addTrans(
    "9999",                    // Order ID
    "My Site",                 // Store name
    "0.00",                    // Total
    "0.00",                    // Tax
    "0",                       // Shipping
    "New York",                // City
    "New York",                // State
    "USA"                      // Country
  );

  pageTracker._addItem(
    "9999",                    // Order ID
    "9999",                    // Product code
    "Newsletter",              // Product Name
    "Lead",                    // Category
    "0.00",                    // Price
    "1"                        // Quantity
  );

  pageTracker._addItem(..);    // Another Item

  pageTracker._trackTrans();   // Track transaction

</script>

7. Save this new file on your web server as /thankyou.html
8. Next, login to your Mailchimp account, click on the Lists tab, then click the appropriate list (if you have more than one), click Create Forms, select Confirmation Signup Page from the drop-down list of forms. Just above the form you will see a box that allows you to enter a substitute URL. Enter the url of the file (ex. http://www.yoursite.com/thankyou.html) you just created and click Save & Exit. This tells Mailchimp to not use their hosted confirmation page but, instead, to redirect the confirmations to your site,  where your page, /thankyou.html,  will then report back to Google via the embedded script that a conversion has just occurred.

Mailchimp Thank You Form Setup Page

Mailchimp Thank You form setup page

Now, test the signup process,  making sure that when you signup for the list you actually get signed up. Then, go out for coffee, because it may take Google 30-60 minutes to report the conversion, depending on how busy their servers are at that time. When you return, open Analytics and go to the E-Commerce -> Product Performance -> Product Overview. You should see the Newsletter product listed, as in the example below.  This means everything is working correctly.

Google Analytics Product Overview Extract

Finally, bring it live by pointing your users to your new self-hosted signup form, /signup.html. Before you do that, of course, you’ll want to spiff up the form a little bit, so it doesn’t look like something you whipped up in a text editor in 30 seconds.

Extra Credit: Goal Tracking & Funnels

So now you’ll be tracking sales and newsletter signups, which will yield your total conversion rate.  But how many conversions are you potentially missing because your signup form is incoherent, too complicated or unconvincing? The tracking process alone doesn’t provide the answer to this question.

Google Analytics solves the problem by providing a feature,  known as Goal Tracking & Funnels, which lets you track each of the several steps in a conversion (landing page, confirmation page, thank you page, etc) so you can learn where people balk. Knowing where things end in a multi-step process will help you to tailor it to be more accommodating, thus decreasing the abandonment rate and increasing conversions. Though most frequently used in the sales process,  it’s also a great tool for any other kind of conversion.

Google Analytics Goal Detail Screen

Google Analytics Goal Detail Screen

I use a very basic form of goal tracking and funnels with my Mailchimp newsletter signups to get an idea of the effectiveness of my signup/landing page. It tells me a) how many people arrived at the signup page and, b) how many actually completed the process. If the ratio is low, I know I have an abandonment problem on the landing page and I can work on improving it through A/B testing. For example, the graphic at right shows the performance of my newsletter goal for today. A 5% abandonment rate is actually excellent; 19 out of 20 people visited the signup page completed the process. On the other hand, the 0.02% overall conversion rate is miserably low, which means I need to do a better job of enticing visitors to that signup page.

This is powerful information, and setting up goal tracking and funnels in Analytics isn’t hard. I’ve made it easier by having you create your own hosted signup form. To find out the rest of the steps,  visit Google’s How Do I Setup Goals and Funnels page.

  • http://www.adaptistration.com Drew McManus

    Although MailChimp offers some really fantastic capabilities, the Analytics limitations you've pointed out here combined with some of the WORST online customer service known to mankind prevent it from taking the lead in market share. After using a dozen of the leading platforms, I've found the recent updates to Vertical Response put it ahead of the pack, especially with the ease of integrating Analytics.

  • http://thewellrunsite.com Michael Johnston

    Drew, I've had nothing but good experiences with Mailchimp customer support the few times I've actually needed to use it. They also do a great job of keeping their customers informed about upgrades and occasional glitches.

    Reasonable people my disagree, but really, “the WORST online customer service known to mankind”? They have a great reputation with me and yours is the first report I've read otherwise.

  • http://www.comparativadebancos.com/ Bancos

    Hello and congrats for the content…

    One question:
    How do you do for having four products (monthly, quarterly,…)?

    I you add the code you propose to the thankyou page, are you able to put there a parameter?
    Please, could you give me some details on this???

    thanks a lot and regards

  • Jaumemarin

    Sweet tip dude!
    Cheers from Spain!

  • http://www.magentomagik.com/ Ashish @Magento Themes

    I have tried Mailchimp & Analytics both and both these tools are simply great. One of my friend told me about Nurturehq.com as well which tracks and tell you whether the email you have sent has been opened or not along with some other useful activities. I would say, use all the tracking tools as these will help you take some tough decisions.

  • Anonymous

    Thanks for the great article, it’s exactly what I was trying to figure out so you saved me some time.
    Don’t forget to give people somewhere to go on that custom “Thank You” page, rather than leave them in a dead-end.
    It’s also a great place to put a “Share/Tweet/Follow” link.

    BTW, I have had a great experience using MailChimp so far.

  • http://www.magento-themes.jextn.com Magento Themes

    I have used Google Analytics for tacking all my campaigns for a long time now and I have found it more user friendly and interesting than the other tools.
    It gives me 80% accuracy which I think is the best for a tracking tool.

  • Bj

    I use the Mailchimp WordPress Plugin & would like to setup the Goal Tracking as a normal goal. Not as an ecommerce goal. Do you know how to do this?

  • http://blog.myfoundationfitness.com Patrick Hitches

    Thanks for the info Michael! Much appreciated… Any insight as to how to track Facebook advertising if you want to track a signup form conversion from my website?

Previous post:

Next post: