New: Revenue First Analytics. See which channels actually drive your WooCommerce revenue. Learn more →

Connect Mailchimp

Last updated

The Mailchimp integration adds each customer’s referral code to their contact in one Mailchimp audience. You can then add their personal referral link to any campaign.

The integration adds every customer to the audience as subscribed. That includes customers who never agreed to marketing emails, and it may re-subscribe people who unsubscribed. If you need consent, for example under GDPR, leave it off. Instead, export the codes and import them into Mailchimp with your own consent rules. See Export referral codes.

1. Add the merge fields

  1. In Mailchimp, open your audience and go to Settings → Audience fields and *|MERGE|* tags.
  2. Add a Text field with the merge tag REFCODE.
  3. Add a Date field with the merge tag REFCREATED.
  4. Save.

Mailchimp rejects contacts with merge tags that don’t exist, so add both fields before you connect.

2. Get your API key and audience ID

  • API key: in Mailchimp, go to Profile → Extras → API keys and create a key.
  • Audience ID: go to Audience → Settings → Audience name and defaults. It’s under Audience ID.

3. Connect the plugin

  1. Go to WooCommerce → Refer a Friend → Integrations.
  2. Under Mailchimp, turn on Enable Integration.
  3. Fill in Mailchimp API Key and Audience (List) ID.
  4. Click Save Settings.
  5. To send codes your customers already have, go to WooCommerce → Status → Tools and click Sync to integrations.

Use the link in campaigns

Add the code to your landing page URL:

https://yourstore.com/?raf=*|REFCODE|*

Use it as a button or link URL in your campaign. For contacts without a code, the link opens your store without a referral.

Check it worked

Create a test customer account, then find that email in your audience. The contact should have a value in the REFCODE field.

If it’s empty, check the merge tags are spelled exactly REFCODE and REFCREATED, and that the key and audience ID are correct. Mailchimp errors are written to your PHP error log, starting with “Mailchimp API Error”.

Related

Browse our plugins

Lightweight WooCommerce plugins built for speed. No bloat, no frameworks -- just clean code that works.

View all plugins
Stay in the loop

Get notified when we launch new plugins. No spam, just product updates.