Connecting Klipfolio to MailChimp

If you want to create custom Klips (in Klipfolio Klips) or custom metrics (in Klipfolio PowerMetrics), then you’re in the right place.

If you want to use pre-built Klips (in Klipfolio Klips) or instant metrics (in Klipfolio PowerMetrics), check out these articles instead: Pre-built Klips and the Klip Gallery or Instant metrics.

 

Visualize, discover, and act on your data with Klips, metrics, and dashboards.

Ready to get the most from your Mailchimp email marketing data? Get started by setting up a connection between Klipfolio and your Mailchimp data and adding some data sources.

When you're finished adding Mailchimp data sources, you'll use them to power your custom Klips and custom metrics.

This article includes:

Connecting to your Mailchimp data

When connecting your Mailchimp data in Klipfolio, you use your Mailchimp API Key to authenticate your identity. You might also need to enter your data center information in the queries provided by Klipfolio or in your own query when building custom data sources.

How do I find my Mailchimp API Key and data center?

To find your Mailchimp API Key and data center:

  1. Click the following link: Your Mailchimp API Key.
  2. Enter your Mailchimp login credentials.
  3. Copy the number that displays in the API Key field. This is your Mailchimp API Key.

Note: The characters following the dash at the end of your API Key are your data center. For example, us12.

Adding a Mailchimp pre-built data source

Our pre-built data sources focus on the most sought-after Mailchimp data. Either use them as complete solutions or as starting points for custom building.

To add a Mailchimp pre-built data source:

  1. Click the + beside Data Sources in the left navigation sidebar.

If you don’t see the option above, go to the bottom of the left navigation sidebar and click your Account Name > Data Sources > Create a New Data Source.

  1. On the Where is your data? page, select Mailchimp.
  2. Select a pre-built data source from the left section of the Choose a pre-built or custom connection page.
  3. On the Configure your data source page, enter your Mailchimp API Key and Data Center Name.
  4. If applicable, after Campaign Title, select a Mailchimp Campaign from the drop-down list.
  5. Click Get data or, if you want to modify the pre-built data request, click Switch to Custom settings.
    Note: If you switch back to the Basic settings page after making changes in the Custom settings page, your changes will not be saved.
  6. Ensure this is the data you’re looking for and, optionally, select the checkbox to Model your data. Note that metrics require modelled data sources. If you're going to use this data source to build custom metrics, we recommend modelling your data now. Learn more about modelling your data source. Note: Mailchimp returns JSON formatted data. Learn how to model JSON data.
  7. Click Continue.
  8. Name, choose refresh settings, and, optionally, share your data source.
  9. Click Save.

If you clicked Switch to Custom settings:

  1. On the Configure your data source page, modify the Query URL to get the data you want. You can use the existing information in the Query URL text box as a base. It was auto-filled based on the pre-built data source you selected on the Choose a pre-built or custom connection page.
  2. Click Get data.
  3. Ensure this is the data you’re looking for and, optionally, select the checkbox to Model your data. Note that metrics require modelled data sources. If you're going to use this data source to build custom metrics, we recommend modelling your data now. Learn more about modelling your data source. Note: Mailchimp returns JSON formatted data. Learn how to model JSON data.
  4. Click Continue.
  5. Name, choose refresh settings, and, optionally, share your data source.
  6. Click Save.

The data source is added to your account and is ready to use for custom Klips and custom metrics. You can see all your data sources in your Data Source Library, accessed by clicking Data Sources in the left navigation sidebar.

Adding a Mailchimp custom data source

Need a unique set of data? When our pre-built data sources don't include exactly what you're looking for, create your own custom data source. You can either use a pre-built data source query as a base or write your own queries from scratch.

To add a Mailchimp custom data source:

  1. Click the + beside Data Sources in the left navigation sidebar.

If you don’t see the option above, go to the bottom of the left navigation sidebar and click your Account Name > Data Sources > Create a New Data Source.

  1. On the Where is your data? page, select Mailchimp.
  2. On the Choose a pre-built or custom connection page, click Create a custom Mailchimp data source.
  3. Adjust the Query URL information, as noted on the Configure your data source page, to replace any generic placeholder query information with your own. For example, replace <dataCentre> with your own data center.
  4. If necessary, edit the Query URL further to return the data you need. Refer to the Mailchimp API documentation for details.
  5. At Data Format, select JSON from the drop-down menu.
  6. At Method select GET from the drop-down menu.
  7. Expand Authentication (OAuth, 2-Step, X-WSSE, or Basic).
  8. At Type, select Basic Http Authentication from the drop-down menu.
  9. At Username, enter the letter 'x'.
  10. At Password, enter your Mailchimp API Key without the data center. For example, if your MailChimp API Key normally reads ax6566x6506556xxx565zz56x5x6x5xxx-us12, omit the -us12 and use the remainder as your password.
  11. Click Get data.
  12. Ensure this is the data you’re looking for and, optionally, select the checkbox to Model your data. Note that metrics require modelled data sources. If you're going to use this data source to build custom metrics, we recommend modelling your data now. Learn more about modelling your data source. Note: Mailchimp returns JSON formatted data. Learn how to model JSON data.
  13. Click Continue.
  14. Name, choose refresh settings, and, optionally, share your data source.
  15. Click Save.

The data source is added to your account and is ready to use for custom Klips and custom metrics. You can see all your data sources in your Data Source Library, accessed by clicking Data Sources in the left navigation sidebar.

Custom building: About APIs and queries

Want to learn more about custom building? This section is for you. Klipfolio connects to hundreds of services in the cloud that have a REST API. If you take the time to learn your service’s API to create queries for the data you want, your possibilities are endless. Here’s a quick overview video on APIs and Klipfolio:

Klipfolio API's 101

If you need help using APIs, ask a data analyst or developer.

Refer to the Mailchimp API documentation to discover more data requests.

See the reference table below for API related information and sample queries.

API Documentation

Mailchimp API documentation

Authentication Method Basic HTTP Authentication
Response Format JSON
Sample Queries

For a list of Mailchimp campaigns:

https://your-data-center.api.mailchimp.com/3.0/campaigns/

For all your Mailchimp lists:

https://your-data-center.api.mailchimp.com/3.0/lists/

Next steps

Great! You've connected to your Mailchimp data and created one (or more) data sources. Now you're ready to use those data sources in custom Klips or custom metrics.

Want to learn more?

Check out these related articles:

Appendix: Editing Mailchimp date ranges

Many Klips that use Mailchimp data need a date range that is dynamic (for example, past 30 days). In this section we're going to change the query from a fixed range to a dynamic one.

  1. Enter ?since_send_time={date.last30Days}at the end of your query URL.
  2. Enter &before_send_time={date.today} at the end of your new query URL (after the since_send_time parameter). Your query should look like this:
    • https://your-data-center.api.mailchimp.com/3.0/campaigns/?since_send_time={date.last30Days}&before_send_time={date.today}
  3. If you want to increase the number of records that the call returns (the default is 10), you can add the count parameter. For example:
    • https://your-data-center.api.mailchimp.com/3.0/campaigns/?since_send_time={date.last30Days}&before_send_time={date.today}&count=100

Common date range expressions:

  • {date.today}
  • {date.last30Days}
  • {date.startOfQuarter}
Have more questions? Submit a request