Skip to content

Latest commit

 

History

History
150 lines (103 loc) · 6.47 KB

mailchimp.md

File metadata and controls

150 lines (103 loc) · 6.47 KB
description
Step-by-step guide to add people to your Mailchimp list using RudderStack

Mailchimp

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 %}

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

{% 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:

{% 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:

Mailchimp Connection Settings 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 %}

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 API Specification documentation.

Adding or updating a user

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 of pending. The subscriber status automatically changes to subscribed once the user confirms the email.
  • If the user already has a subscriber status such as pending, subscribed, unsubscribed or cleaned, 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 %}

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.

{% hint style="info" %} The identify call will not change in this case. {% endhint %}

Overriding listId

If you have multiple lists that your users can subscribe to, you can override the default listIdas 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

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: "[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 %}

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 is us20 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 on our Slack channel; we will be happy to talk to you!