# Mailchimp

:::tip Available
This integration is available in Frihet. Configure it in **Settings → Integrations → Mailchimp**.
:::

Connect your Mailchimp account to Frihet to automatically synchronize your clients with audiences and mailing lists. Mailchimp is one of the most widely used email marketing platforms in the world, with tools for automated campaigns, advanced segmentation, and engagement analytics. With this integration, every client you add or update in Frihet is reflected in your Mailchimp lists without manual intervention.

## What is it for?

- **Automatic Contact Synchronization** — Your Frihet clients are automatically added as subscribers to the Mailchimp audiences you choose
- **Segmentation by Commercial Activity** — Create segments in Mailchimp based on real invoicing data: active, new, with pending invoices, or inactive clients
- **Smart Tags** — Exported contacts include tags with Frihet information such as plan, invoicing volume, and age
- **Always Up-to-Date Data** — When you update a client's email or name in Frihet, it automatically updates in Mailchimp
- **Event-Based Campaigns** — Use the synchronized data to trigger campaigns when a client receives an invoice, completes a payment, or has been inactive for a while

## Requirements

- Active account on [Mailchimp](https://mailchimp.com)
- Frihet Pro or Premium Plan
- Mailchimp API Key
- At least one audience (list) created in Mailchimp

## How to Connect

### Step 1: Obtain your API Key in Mailchimp

1. Log in to [mailchimp.com](https://mailchimp.com)
2. Click on your avatar and select **Account & billing**
3. Navigate to **Extras → API keys**
4. Click on **Create A Key**
5. Give it a descriptive name, for example "Frihet ERP"
6. Copy the generated API Key (it has the format `xxxxxxxxxxxxxxxx-usXX`, where `usXX` indicates the datacenter)

### Step 2: Configure in Frihet

1. In Frihet, go to **Settings → Integrations**
2. Find **Mailchimp** and click on the card
3. Paste your **API Key** in the corresponding field
4. Click on **Test Connection** to verify that the credentials are correct
5. Select the **audience** (list) where you want to synchronize your clients
6. Click on **Save**

### Step 3: Initial Synchronization

1. Once connected, click on **Synchronize Now** to export your existing clients to Mailchimp
2. Verify in Mailchimp that the contacts appear in the selected audience

## Data Synchronized

| Data | Direction | Details |
|------|-----------|----------|
| Client Email | Frihet → Mailchimp | Used as the unique subscriber identifier |
| First and Last Name | Frihet → Mailchimp | Subscriber FNAME and LNAME fields |
| Company | Frihet → Mailchimp | COMPANY merge field |
| Tags | Frihet → Mailchimp | Activity-based tags: plan, status, age |
| Subscription Status | Mailchimp → Frihet | If a contact unsubscribes in Mailchimp, it is marked in Frihet |

## Use Cases

### Freelancer Sending Newsletters to Clients

You have a client list in Frihet and want to send them a monthly newsletter with updates. With the integration, every new client you add in Frihet automatically appears in your Mailchimp list. You don't need to export CSVs or copy data manually.

### Agency with Segmented Campaigns

You manage dozens of clients in Frihet. You want to send a campaign only to active clients who have paid in the last 3 months. The tags synchronized from Frihet allow you to create that segment directly in Mailchimp without manually manipulating data.

### E-commerce with Post-Purchase Tracking

You sell products and generate invoices in Frihet. You want to send a thank-you email after each purchase and a reminder to clients who haven't purchased in 30 days. Mailchimp data is kept up-to-date with Frihet's real activity.

## Troubleshooting

### Connection Error

- Verify that the API Key is correct and has not been revoked
- Check that the API Key suffix matches your datacenter (e.g., `us21`)
- If you regenerated the API Key in Mailchimp, update it in Frihet

### Contacts Do Not Appear in Mailchimp

- Ensure that clients in Frihet have a registered email — without an email, they cannot be synchronized
- Verify that the audience selected in Frihet exists and has not been archived in Mailchimp
- Check that you have not reached your Mailchimp plan's contact limit

### Contact Marked as Unsubscribed

- If a contact unsubscribes from a Mailchimp email, they cannot be automatically re-added (CAN-SPAM compliance)
- The contact remains in Frihet but appears as unsubscribed in Mailchimp
- To re-subscribe, the contact must manually confirm from Mailchimp

### Outdated Data

- Synchronization runs when you create or edit a client in Frihet
- If you modified data directly in Mailchimp, those changes are not reflected in Frihet (unidirectional contact synchronization)

## Next Steps

- [Connect Slack to receive payment notifications](./slack)
- [Manage your clients in Frihet](../clientes/gestion-clientes)
- [Import clients from CSV](../clientes/importar-exportar)
