# Mailchimp connector

> Connect Mailchimp with an API key. Campaign sends, opens, clicks and unsubscribes join each customer, and Datacenter writes back merge fields and tags.

Source: https://datacenter.so/docs/mailchimp-connector
Section: Measure

The Mailchimp connector works in two directions:

- **In:** campaign sends, opens, clicks and unsubscribes join each [customer profile](https://datacenter.so/docs/customer-profiles).
- **Out:** Datacenter writes each customer's first and last source, lifetime value, orders and best send hour into merge fields. Segments you pick become tags.

It is on paid plans: Solo, Studio, Agency and Custom. Free does not include it.

**Connect with Mailchimp (when shipped).** A one-click login: click **Connect**, log in to Mailchimp in the new tab and allow access, and you are done, with no key to paste. Until it is switched on, use the steps below.

## Connect

1. In Datacenter, open your site, then **Settings**, then **Integrations**. Under **Email and texts**, click **Connect** next to **Mailchimp**.
2. In Mailchimp, click your profile icon, then **Profile**. Open **Extras**, then **API keys**.
3. Click **Create A Key** and name it `Datacenter`.
4. Copy the whole key. It ends with a dash and your server, like `-us6`.
5. Paste it into Datacenter and click **Connect Mailchimp**.

Datacenter reads your server from the end of the key, so you never type it.

Mailchimp keys cannot be limited to some data. Any key can read and change the whole account. Datacenter only reads campaign reports and writes its own merge fields and tags. If that is too much access for you, use the [Events API](https://datacenter.so/docs/bring-your-data-together) from a tool such as Zapier instead.

The key is stored encrypted. It is never shown again, and it never appears in logs.

## What comes in

Datacenter reads Mailchimp's campaign reports:

| Mailchimp report | On the customer |
|---|---|
| Sent to | **Email sent** |
| Email activity: open | **Email opened** |
| Email activity: click | **Email clicked**, with the link (without its query string) |
| Unsubscribes | **Unsubscribed from email** |

Each item shows the campaign's subject line.

- **The first import** reads campaigns sent in the last 90 days, up to 100 campaigns.
- **After that**, every 15 minutes, Datacenter reads opens, clicks and unsubscribes for campaigns sent in the last 30 days, and sends for new campaigns.
- Automated emails (Customer Journeys) have no campaign report in Mailchimp's API, so they are not read. Their clicks still show up as visits when the links carry UTM tags.

### Who the customer is

Datacenter finds the customer by the member's email (hashed with SHA-256) and by Mailchimp's member id in each audience.

- A **click** or an **unsubscribe** can add a new customer.
- A **send** or an **open** only joins a customer Datacenter already knows.

## What goes back

Mailchimp merge tags are at most 10 characters, so the names are short. Datacenter makes these fields in each audience the first time, hidden from signup forms:

| Merge tag | Field name | What it holds |
|---|---|---|
| `STFIRST` | Datacenter first source | Where they first came from |
| `STLAST` | Datacenter last source | Where they came from last |
| `STLTV` | Datacenter lifetime value | Lifetime value |
| `STORDERS` | Datacenter orders | Number of orders |
| `STBESTHR` | Datacenter best send hour | Their best hour, 0 to 23, in their time zone |
| `STTZ` | Datacenter time zone | The time zone that hour is in |

- Datacenter only updates members Mailchimp already has. It never adds members and never changes their status.
- A member is sent again only when one of the values changed.
- Your plan limits how many merge fields an audience can have. If an audience is full, those fields are not made.
- To stop, click **Stop sending back** on the connector's page.

### Segments as tags

Each [segment](https://datacenter.so/docs/segments-and-best-send-time) you send to Mailchimp becomes a tag named `Datacenter: ` and the segment's name. Datacenter adds the tag to members who match and takes it off members who stop matching, every 15 minutes.

## If something goes wrong

- **Mailchimp did not accept the key.** It was turned off or deleted. Make a new key and paste it.
- **Mailchimp is busy right now.** Nothing to do. Datacenter tries again every 15 minutes. This shows only after 6 hours with nothing read; a shorter outage is in the sync log alone.
- **Paused. Connectors are on paid plans.** The plan changed to Free.

## Disconnect

Click **Disconnect** on the connector's page. The key is deleted at once. Items already imported stay on your customers, and the fields and tags stay in Mailchimp. Delete the key in Mailchimp too.
