> For the complete documentation index, see [llms.txt](https://docs.anedot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.anedot.com/integrations/email-marketing-communication/mailchimp.md).

# Mailchimp

Connect Anedot to Mailchimp to sync donation and lead contacts for email or messaging campaigns and lists from Settings → Integrations → Directory.

> For the complete documentation index, see [llms.txt](https://anedot.gitbook.io/anedot-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://anedot.gitbook.io/anedot-docs/integrations/email-marketing-communication/mailchimp.md).

## Mailchimp

Connect Anedot to Mailchimp to automatically sync donation and lead data, configure Action Page settings, map standard and custom fields with merge tags, and manage supporter profiles within your Mailchimp audience.

Mailchimp is a marketing automation platform that enables you to manage email campaigns, build subscriber lists, and engage donors through targeted outreach.

Anedot’s integration with Mailchimp allows donation and lead data from Action Pages to be automatically relayed and synced with your Mailchimp audience.

### Connecting Anedot to Mailchimp

To set up the integration:

1. In your Anedot account, go to **Settings → Integrations → Directory**.
2. Click **+ New Connection**.
3. Select **Mailchimp** from the integrations list.
4. Choose the **Action Pages** to sync *(default is all)*.
   * To exclude specific pages, enter a comma-separated list of their IDs.
5. *(Optional)* Limit the integration to a specific **Team**.
6. Enter your **Mailchimp API Key** *(must be a Private API Key)*.
7. Enter your **Audience ID** *(also known as List ID)*.
   * If you need help locating these, contact **Mailchimp Support**.
8. Click **Save** to complete the connection.

*You can update Action Pages, Team settings, and credentials at any time after setup.*

### Data Relays

* Relays are sent for both **financial** and **non-financial** pages.
* You can use **Push Unsent** to resend past or failed relays by specifying a date range.
  * After **5 failed attempts**, the integration is marked **inactive** and will stop sending relays.

#### How Mailchimp Handles Data

* Mailchimp deduplicates contacts based on **email address**.
* If a supporter donates again using the same email but different personal info (e.g., name), the **latest submission data** will overwrite the previous values.
* Relays automatically create or update contact profiles, but Mailchimp **does not send notifications** when this occurs.

### Field Mapping

To properly sync data, set up your **Audience fields and |MERGE| tags** in Mailchimp under: **Audience → View Contacts → Settings → Audience fields and |MERGE| tags**

Here’s how Anedot fields map to Mailchimp tags:

| Anedot Field       | Mailchimp Merge Tag                    |
| ------------------ | -------------------------------------- |
| First Name         | FNAME                                  |
| Last Name          | LNAME                                  |
| Phone              | PHONE                                  |
| Address Line 1     | STREET                                 |
| Address Line 2     | STREET2                                |
| City               | CITY                                   |
| State              | STATE                                  |
| Zip Code           | ZIPCODE                                |
| UTM Campaign       | UTMCAMPGN                              |
| UTM Content        | UTMCONTENT                             |
| UTM Medium         | UTMMEDIUM                              |
| UTM Source         | UTMSOURCE                              |
| UTM Term           | UTMTERM                                |
| Source Code        | SRCECODE                               |
| Event              | EVENT ( Anedot: Submission Completed ) |
| Donation Amount    | AMOUNT                                 |
| Submission Date    | DONATEDATE                             |
| Page URL           | DONATEURL                              |
| Fund ID and Amount | FUNDALLOC                              |
| Phone Consent      | OPTINPHONE                             |
| Email Consent      | OPTINEMAIL                             |

### Custom Fields

Anedot also supports relaying **Custom Fields** added to Action Pages.

To display Custom Field data in Mailchimp:

1. In the **Action Page Builder**, go to the **Form** tab and edit the desired Custom Field.
2. Create a **Mailchimp Merge Tag** that follows these rules:
   * Remove **spaces** and **special characters**.
   * Use only the **first 10 characters**, all in **uppercase**.

**Example:**

* Custom Field Label: *"Which feature would you like to learn more about?"*
* Merge Tag Sent: `WHICHFEATU`

3. Ensure this exact tag is set up in Mailchimp under your Audience field settings.

> *If you have multiple Custom Field Labels that begin with the same 10 characters, adjust the labels to ensure each tag is unique.*

### Payload Data

#### Request Headers

```
{}
```

#### Request Body

```json
{"merge_fields":{"CITY":"New Orleans","EVENT":"Anedot: Submission Completed","FNAME":"Annie","LNAME":"Dot","PHONE":"8765678987","STATE":"LA","AMOUNT":"100.0","STREET":"1340 Poydras St","STREET2":"","UTMTERM":"","ZIPCODE":"70112","BIRTHDAY":"","SRCECODE":"","DONATEURL":"https://secure.anedot-sandbox.com/09388ffc-9f3f-43ee-855a-1f70c7a9b764/cab0834d-ad6d-4177-8125-1da2c194f5ef","FUNDALLOC":"InternalIdentifier:1001,Amount:100.0","UTMCAMPGN":"","UTMMEDIUM":"","UTMSOURCE":"","DONATEDATE":"05/05/2023","UTMCONTENT":""},"email_address":"annie@anedot.com","status_if_new":"subscribed"}
```

#### Response Body (Success)

```json
{"id":"96e28bd38b0f19d052922a4aadc6d539","vip":false,"tags":[],"stats":{"avg_open_rate":0,"avg_click_rate":0},"_links":[{"rel":"self","href":"https://us20.api.mailchimp.com/3.0/lists/c90e84a68f/members/96e28bd38b0f19d052922a4aadc6d539","method":"GET"},{"rel":"parent","href":"https://us20.api.mailchimp.com/3.0/lists/c90e84a68f/members","method":"GET"},{"rel":"update","href":"https://us20.api.mailchimp.com/3.0/lists/c90e84a68f/members/96e28bd38b0f19d052922a4aadc6d539","method":"PATCH"},{"rel":"upsert","href":"https://us20.api.mailchimp.com/3.0/lists/c90e84a68f/members/96e28bd38b0f19d052922a4aadc6d539","method":"PUT"},{"rel":"delete","href":"https://us20.api.mailchimp.com/3.0/lists/c90e84a68f/members/96e28bd38b0f19d052922a4aadc6d539","method":"DELETE"}],"ip_opt":"52.13.182.211","source":"API - Generic","status":"subscribed","web_id":600306575,"list_id":"c90e84a68f","language":"","location":{"dstoff":0,"gmtoff":0,"region":"","latitude":0,"timezone":"","longitude":0,"country_code":""},"full_name":"Annie Dot","email_address":"annie@anedot.com","member_rating":2,"merge_fields":{"CITY":"New Orleans","EVENT":"Anedot: Submission Completed","FNAME":"Annie","LNAME":"Dot","PHONE":"8765678987","STATE":"LA","AMOUNT":100,"STREET":"1340 Poydras St","STREET2":"","ZIPCODE":"70112","DONATEURL":"https://secure.anedot-sandbox.com/09388ffc-9f3f-43ee-855a-1f70c7a9b764/cab0834d-ad6d-4177-8125-1da2c194f5ef","FUNDALLOC":"InternalIdentifier:1001,Amount:100.0","DONATEDATE":"2023-05-05"}}
```

#### Response Body (Failure 1)

```json
{"type":"https://mailchimp.com/developer/marketing/docs/errors/","title":"Resource Not Found","detail":"The requested resource could not be found.","status":404,"instance":"3b8bda84-fdad-22ea-6fec-9ae4c79379ca"}
```

#### Response Body (Failure 2)

```json
{"type":"https://mailchimp.com/developer/marketing/docs/errors/","title":"API Key Invalid","detail":"Your API key may be invalid, or you've attempted to access the wrong datacenter.","status":401,"instance":"207e182a-1468-3455-a18f-41d286d25188"}
```

#### Response Body (Error)

```
{}
```

#### Response Status (Success)

```
200
```

#### Response Status (Failure 1)

```
404
```

#### Response Status (Failure 2)

```
401
```

#### Response Status (Error)

```
null
```

***

## Agent Instructions

This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

### Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://anedot.gitbook.io/anedot-docs/integrations/email-marketing-communication/mailchimp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language. `goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.anedot.com/integrations/email-marketing-communication/mailchimp.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
