Import MailChimp Automations in Google Data Studio

November 16, 2018 - Written by

Few months ago I wrote an article focused on how to import Mailchimp Campaign data in Google Data Studio.

Now, thanks to your requests and to achieve a full implementation, I just build a new script useful to import the MailChimp Automations’ data into Google Data Studio.

How can we do this? Please follow the next steps.

Find MailChimp Automation’s ID

First of all, you have to create a new MailChimp API Key.

Please follow the path MailChimp Login > Account > Extras > API Keys > Create a Key to create and grab the key.

api keys mailchimp

Now we need to grab the Automations ID created in MailChimp. In order to do this, visit the MailChimp Playground page and insert your API Key into the  search box.

MailChimp API Playground

In the second page find “Automations” and click on it.

MailChimp API Playground Automations

Now you have access to all your automations. Click on the first Automation in order to grab the MailChimp Automations’ ID, as showed in the following screenshot:

MailChimp API Playground Automations singleID

Repeat the previous steps for each automation you have set in your account.

Import Mailchimp Automations data in Google Spreadsheet

At this point we need to create a bridge between MailChimp and Google Data Studio using another Google product: Spreadsheet.

First step: create a new file and go to Tools > Script Editor

Second step: download and copy the MailChimp automations in Data Studio into the Script Editor

Third step: insert the MailChimp API Key into the var API_KEY and put the Automations ID into the var workarr. Remember, insert the Automations ID into the []

Google Spreadsheet Automations MailChimp

Fourth step: click on Save and then click on Run (the play button)

Fifth step: accept all the authorization requests

Now your Google SpreadSheet starts to be filled with the MailChimp Automation data as:

  • Title
  • Subject
  • Opens
  • Unique Opens
  • Open Rate
  • Clicks
  • Subscribers Clicks
  • Click Rate

You can set an automation to get fresh data using the script triggers. In the script editor click on Modify > Trigger current project > Add Trigger and choose when you want to start the update.

Google Spreadsheet Automations MailChimp triggers

Import Google Spreadsheet data in Google Data Studio

The most easy part of the project is to connect the Google Spreadsheet file as a source in Google Data Studio and select which dimensions and metrics you want to represent.

Import Google Data Studio Interface

Adding more info in Google Data Studio

If you want to understand the whole mail customer journey you can merge the MailChimp data with the post click information set in Google Analytics using the Google Data Studio’s blending feature. 

Isn’t it cool, what do you think? Any suggestions are welcome!

Comments 14 Replies to “Import MailChimp Automations in Google Data Studio”
  1. Hi – great piece of code. Is there anyway to retrieve campaign data and automation data in the one script? I assume you would need to limit campaign data fields to only those available with automation data?
    Any help would be appreciated!

  2. This has been amazing and so helpful!
    My Automations have multiple drips. continues to put one drip after another on the same line, which is ideal. But for some reason, they are in the proper order. Any idea on how to solve this?

    Thanks again for making this available!

  3. Hi! There are 37 emails sent in my campaign, but the code got only 10 of them. You have an idea why this happen?


  4. Hello! Thank you so much for this information!

    When I sync the data, all the e-mails sent appear on a row, instead of vertically. Is there anyway to fix this?

    And also, can I organize the e-mails by date?

    Thanks you!

    • I also noticed it has only imported 10 e-mails. Is there any way I can visualize all of them?

      Thanks in advance!

      • Hi Luisa,
        It looks like strange.. Do you set all the MCautomations’ ID in the script?

    • I’m having the same issues! I only put in 1 Automations ID though, could that be a problem? I was hoping to see all the emails (+ the data) within that automation on seperate rows.
      Any advice?

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Analytics Boosters

    Vicolo Buranelli, 2
    31100 Treviso

  • Analytics Boosters
    United Kingdom

    41 Devonshire Street
    W1G 7AJ
    United Kingdom

  • Analytics Boosters
    United States

    80 S.W. 8th Street
    33130 - Miami
    United States of America


Contact us