If you want to create data sources for custom Klips, you're in the right place.
If you want to add pre-built Klips, see Pre-built Klips and the Klip Gallery and Klip Gallery: Mailchimp.
If you're using PowerMetrics and want to create data sources for custom metrics, go here.
Visualize, discover, and act on your data with Klips and Klip 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.
This article includes:
- What you should know about connecting to your Mailchimp data
- Finding your Mailchimp API Key and data center
- Adding a Mailchimp pre-built data source
- Adding a Mailchimp custom data source
- Custom building: About APIs and queries
- I've added Mailchimp data sources - What's next?
- Appendix: Editing Mailchimp date ranges
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:
- Click the following link: Your Mailchimp API Key.
- Enter your Mailchimp login credentials.
- 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:
- 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.
- On the Where is your data? page, select Mailchimp.
- Select a pre-built data source from the left section of the Choose a pre-built or custom connection page.
- On the Configure your data source page, enter your Mailchimp API Key and Data Center Name.
- If applicable, after Campaign Title, select a Mailchimp Campaign from the drop-down list.
- 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. - Ensure this is the data you’re looking for and, optionally, select the checkbox to Model your data. Learn more about modelling your data source. Note: Mailchimp returns JSON formatted data. Learn how to model JSON data.
- Click Continue.
- Name, choose refresh settings, and, optionally, share your data source.
- Click Save.
If you clicked Switch to Custom settings:
- 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.
- Click Get data.
- Ensure this is the data you’re looking for and, optionally, select the checkbox to Model your data. Learn more about modelling your data source. Note: Mailchimp returns JSON formatted data. Learn how to model JSON data.
- Click Continue.
- Name, choose refresh settings, and, optionally, share your data source.
- 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:
- 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.
- On the Where is your data? page, select Mailchimp.
- On the Choose a pre-built or custom connection page, click Create a custom Mailchimp data source.
- 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.
- If necessary, edit the Query URL further to return the data you need. Refer to the Mailchimp API documentation for details.
- At Data Format, select JSON from the drop-down menu.
- At Method select GET from the drop-down menu.
- Expand Authentication (OAuth, 2-Step, X-WSSE, or Basic).
- At Type, select Basic Http Authentication from the drop-down menu.
- At Username, enter the letter 'x'.
- 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.
- Click Get data.
- Ensure this is the data you’re looking for and, optionally, select the checkbox to Model your data. Learn more about modelling your data source. Note: Mailchimp returns JSON formatted data. Learn how to model JSON data.
- Click Continue.
- Name, choose refresh settings, and, optionally, share your data source.
- Click Save.
The data source is added to your account and is ready to use for custom Klips. 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:
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 | |
Authentication Method | Basic HTTP Authentication |
Response Format | JSON |
Sample Queries |
For a list of Mailchimp campaigns:
For all your Mailchimp 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.
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.
- Enter
?since_send_time={date.last30Days}
at the end of your query URL. - Enter
&before_send_time={date.today}
at the end of your new query URL (after thesince_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}
- 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}