description |
---|
Step-by-step guide to add people to your Mailchimp list using RudderStack |
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.
{% hint style="success" %} Find the open-source transformer code for this destination in our GitHub repo. {% endhint %}
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 |
{% hint style="info" %} To know more about the difference between Cloud mode and Device mode in RudderStack, read the RudderStack connection modes guide. {% endhint %}
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.
{% hint style="info" %} Please follow our guide on How to Add a Source and Destination in RudderStack to add a source and destination in RudderStack. {% endhint %}
- 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.
{% hint style="info" %} 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. {% endhint %}
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 API Specification documentation.
Let us consider a sample identify
call in RudderStack:
rudderanalytics.identify("user123", {
firstName: "John",
lastName: "Doe",
email: "[email protected]"
});
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.
{% hint style="info" %}
For the identify
call in RudderStack, email is a required field. The rest of the fields must match the Merge Field tag in Mailchimp.
{% endhint %}
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.
{% hint style="info" %}
The identify
call will not change in this case.
{% endhint %}
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: "[email protected]"
},
{
integrations: {
MailChimp: {
listId: "esf1rd234a"
}
}
}
);
In the example above, we override the default listId
with the listId
as esf1rd234a
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: "[email protected]"
},
{
integrations: {
MailChimp: {
subscriptionStatus: "unsubscribed"
}
}
}
);
{% hint style="info" %}
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.
{% endhint %}
To get the Mailchimp API Key, log in to Mailchimp, and go to Account - Extras - API Keys
You can find the Mailchimp Audience ID by logging in to Mailchimp and navigating to Audience - Manage Audience - Settings - Audience name and defaults
- 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.
If you come across any issues while configuring Mailchimp with RudderStack, please feel free to contact us. You can also start a conversation on our Slack channel; we will be happy to talk to you!