Mailchimp is a popular email marketing automation platform used worldwide by thousands of businesses. Built specially for eCommerce and retail, Mailchimp allows you to build your audience and send them personalized campaign and marketing messages through web or mobile.
RudderStack allows you to add people to your Mailchimp list via a simple identify
call.
Getting started
Before configuring Mailchimp as a destination in RudderStack, please make sure that the source platform is supported by Mailchimp. You can refer to the following table to do so:
Connection Mode | Web | Mobile | Server |
---|---|---|---|
Device mode | - | - | - |
Cloud mode | Supported | Supported | Supported |
Once you have confirmed that Mailchimp supports the source type, perform the steps below:
- From your RudderStack dashboard, add the source and Mailchimp as a destination.
- Give a suitable name to the destination, and then click on Next. You should then see the following screen:
- Enter the relevant information in the fields such as the Mailchimp API Key, Audience ID and DataCenter ID. Then, click on Next.
It is recommended that you create a new API key for your RudderStack destination. Mailchimp restricts each API key to a maximum of 10 concurrent requests. Hence, creating a dedicated key for RudderStack ensures maximum throughput for the outgoing calls. Please read more about the API keys by going to Mailchimp’s documentation.
Identify
The identify
call captures the details about the visiting user along with the properties associated with that user. For more information, please refer to our RudderStack Events Specification documentation.
Adding or updating a user
Let us consider a sample identify
call in RudderStack:
rudderanalytics.identify("user123", { firstName: "John", lastName: "Doe", email: "namesurname@domain.com"});
Every time an identify
call is made with an email address included, RudderStack performs the following steps:
- RudderStack first checks with Mailchimp whether that specific email address exists for the
listId
provided in the destination settings. - If the email address does not exist in the list, RudderStack will subscribe the associated user to the list immediately. If the
doubleOptIn
setting is enabled, Mailchimp will send a confirmation email to that user, and that email will be tagged with a subscriber status ofpending
. The subscriber status automatically changes tosubscribed
once the user confirms the email. - If the user already has a subscriber status such as
pending
,subscribed
,unsubscribed
orcleaned
, RudderStack will not resubscribe them, but only update their associated user traits.
For the identify
call in RudderStack, email is a required field. The rest of the fields must match the Merge Field tag in Mailchimp.
Using custom merge fields in RudderStack
To send custom merge fields or user traits to Mailchimp, please follow these steps:
- Create the merge field in Mailchimp for every trait you want sent to it.
- When you make the
identify
call, the keys that match the traits above will automatically appear in your Mailchimp list.
The identify
call will not change in this case.
Overriding listId
If you have multiple lists that your users can subscribe to, you can override the default listId
as a parameter to Mailchimp.
Consider the following code snippet:
rudderanalytics.identify( "userId123", { email: "namesurname@domain.com" }, { integrations: { MailChimp: { listId: "esf1rd234a" } } });
In the example above, we override the default listId
with the listId
as esf1rd234a
Updating the subscription status
RudderStack gives you the option of manually updating the subscription status of a user. Simply pass on an additional parameter to Mailchimp called subscriptionStatus
.
An example of how to do this is as shown in the code snippet below:
rudderanalytics.identify( "userId123", { email: "namesurname@domain.com" }, { integrations: { MailChimp: { subscriptionStatus: "unsubscribed" } } });
Please note that this setting will NOT work for new users. New users will always have the subscription status set for them as either pending
or subscribed
, depending on the set doubleOptIn
setting.
FAQs
Where do I get the Mailchimp API Key?
To get the Mailchimp API Key, log in to Mailchimp, and go to Account - Extras - API Keys
Where do I get the Mailchimp Audience ID?
You can find the Mailchimp Audience ID by logging in to Mailchimp and navigating to Audience - Manage Audience - Settings - Audience name and defaults
Where do I get the Mailchimp DataCenter ID?
- To get the DataCenter ID, please refer to your Mailchimp URL in the browser. For example, if the URL is
https://us20.admin.mailchimp.com/lists
, the DataCenter ID isus20
in this case.
Contact us
If you come across any issues while configuring Mailchimp with RudderStack, please feel free to contact us. You can also start a conversation in our Slack community; we will be happy to talk to you!