Use Mailchimp for Shopify
Mailchimp for Shopify automatically syncs customers and their purchase data to Mailchimp. Use Shopify data to create targeted campaigns, or use our e-commerce link tracking to track sales and measure your ROI.
In this article, you’ll learn how to connect Mailchimp for Shopify, view your customers in Mailchimp, send an email from Shopify and disconnect the Mailchimp for Shopify app.
Before You Start
Here are some things to know before you begin this process.
- Each Shopify store must be connected to a separate list in your Mailchimp account. To connect multiple Shopify stores, connect each store to its own list. You cannot connect the same Shopify store to more than one list or Mailchimp account.
- To view the e-commerce features supported by this integration, visit the Shopify listing in your account.
- This integration is compatible with our API version 3.0.
- Shopify customers who haven’t signed up for marketing emails will appear in your list as non-subscribed contacts, and can get transactional emails or social ads. However, these addresses can’t be exported.
- When you disconnect a Shopify store from Mailchimp, the store’s purchase data, and some list members, will be removed from your Mailchimp account within 30 days.
- To avoid seeing out-of-stock items in Product Recommendations, turn on inventory tracking in Shopify.
- If you decide to use our Order Notifications automation, choose not to send notifications from Shopify and elsewhere to avoid duplicate emails. To learn more, read Use Mailchimp Order Notifications With Shopify.
How it Works
Mailchimp for Shopify syncs your customers and their orders to your Mailchimp account. Product orders will be stored in contact profiles and campaign reports.
The first time you connect, existing Shopify store customers who agreed to accept marketing emails will be imported to your Mailchimp list as subscribed contacts. Customers who haven’t opted in to email marketing will be added as non-subscribed contacts. After that, we’ll continue to import new customers as subscribed or non-subscribed based on whether they opt in to email marketing at checkout. To learn more about different contact types, read About Your Contacts
The sync adds each customer’s first name, last name, email address, physical address, and company to your Mailchimp list.
If a contact unsubscribes from a campaign, or if you manually unsubscribe them, we’ll remove them from your Mailchimp list. Their marketing status in Shopify will not change.
To connect your Shopify store to a list in Mailchimp, follow these steps.
- Click your profile name, and choose Connected Sites
- Click Shopify.
- Click Connect.
- On the Shopify installation screen, click Add app.
- Enter the URL for your Shopify store, and click Log in.
- Enter your login credentials, then click Log in again.
- Click Connect existing account. If you don’t have a Mailchimp account, click Create new account. After you verify your account information, you’ll be prompted to create a secure password via email to activate your new account.
- Choose a Mailchimp list to connect to your store, and click Connect List.
That’s it! After you connect Mailchimp for Shopify, you can view your store’s details in the Connected Sites page in Mailchimp. From there you can change your synced list, send e-commerce automations to your customers, add a pop-up signup form to your store, and view reporting data.
Segment Shopify Customers
With Mailchimp for Shopify connected, you can create segments that target subscribers based on data like product purchased, total number of orders, or purchase date.
To segment your Shopify customers in Mailchimp, follow these steps.
- Navigate to the Lists page in your Mailchimp account.
- Click the name of the list you want to work with.
- Click New Segment.
- Set the drop-down menus to Signup Source | source was | Mailchimp for Shopify.
- Click Preview Segment.
- Review the segment, and click Save Segment.
- In the pop-up modal, type a name for your segment, click Save.
After you connect to Shopify, you can do a lot with the the data you collect, like build segments, send automations, track purchases, and view results.
Find out everything Mailchimp has to offer with these guides.
To disconnect your Shopify store, you’ll need to remove the site from Mailchimp and also remove the app from Shopify. When you disconnect a Shopify store from Mailchimp, the store’s purchase data, and some list members, will be removed from your Mailchimp account within 30 days.
To remove your Shopify store from Mailchimp, follow these steps.
- Click your profile name, and choose Connected Sites.
- Click Disconnect.
- In the Are you sure? pop-up modal, click Continue to proceed with disconnecting your store.
Almost done! To fully uninstall Mailchimp for Shopify, you’ll also need to remove the app from your Shopify account. Check out Shopify’s guide on How to Uninstall an App.
Send data into Slack in real-time.
Incoming Webhooks are a simple way to post messages from apps into Slack. Creating an Incoming Webhook gives you a unique URL to which you send a JSON payload with the message text and some options. You can use all the usual markup and attachments with Incoming Webhooks to make the messages stand out.
You can’t use Incoming Webhooks with Workspace Apps right now; those apps can request single channel write access and then use chat.postMessage in the Web API to post messages, providing very similar functionality to Incoming Webhooks.
There are a few HTTP request examples in our guide, and to test these you can use something like cURL (a simple, ubiquitous tool for sending HTTP requests on the command line) or if you prefer a GUI you can also use a tool like Postman.
Getting started with Incoming Webhooks
We’re going to walk through a really quick 4-step process (if you’ve already done some of these things it’ll be even easier) that will have you posting messages using Incoming Webhooks in a few minutes:
1. Create a Slack app (if you don’t have one already)
You won’t get very far without doing this step, but luckily it’s very simple, we even have a nice green button for you to click for it:
Pick a name, choose a workspace to install your app to (bearing in mind that you’ll probably be posting lots of test messages, so you might want to create a channel for sandbox use), and then click Create App. If you’ve already created one, you can use it too, also have a cookie 🍪.
2. Enable Incoming Webhooks
After creating, you’ll be redirected to the settings page for your new app (if you are using an existing app, just load its settings via the Your Apps page).
From here select the Incoming Webhooks feature, and click the Activate Incoming Webhooks toggle to switch it on. If you already have this activated, well you deserve another cookie 🍪.
3. Create an Incoming Webhook
Now that Incoming Webhooks are enabled, the settings page should refresh and some extra options will appear. One of those options will be a really helpful button marked Add New Webhook to Workspace, and you should click it.
What this button does is trigger a shortcut version of the installation flow for Slack apps, one that is completely self-contained so that you don’t have to actually build any code to generate an Incoming Webhook URL. We’ll talk more about that later on, but for now you’ll see something like the following screen:
So go ahead and pick a channel that the app will post to, and then click to Authorize your app. You’ll be sent back to your app settings, and you should now see a new entry under the Webhook URLs for Your Workspace section, with a Webhook URL that’ll look something like this:
That URL is your shiny new Incoming Webhook, one that’s specific to a single user, and a single channel. We’ve kind of run out of cookies, but nice work anyway! Let’s see how you can actually use that webhook to post a message.
4. Use your Incoming Webhook URL to post a message
Later in this doc we’ll explain how to make your messages more expressive or interactive, but for right now something simple will do, so we’re going to use that old standby – "Hello, world".
After all this build up, you might think posting a message will be really complicated, but it’s very simple. Just make an HTTP POST request like this:
The URL that you’re making the POST request to should be the same URL you generated in the previous step.
That’s it! Go and check the channel that your app was installed into, and you should see that the "Hello, World" message has been posted by your app.
You can use this in a real Slack app without much change, just substituting your favorite HTTP Request library for cURL, but structuring all the requests in the exact same way. You will also need to pay attention to some details we’ve outlined below when you’re distributing your app.
Great work, you’ve set up Incoming Webhooks for your Slack app and made a successful test call, and you’re ready to start making those messages more interesting and useful. Also, we baked some extra cookies to celebrate 🍪🍪🍪🍪.
Making it fancy with advanced formatting
Incoming Webhooks conform to the same rules and functionality as any of our other message related APIs. You can make your posted messages as simple as a single line of text, or make them really complex with interactive buttons and menus.
The process of using all these extras and features is exactly the same as the one explained above; the only difference is the JSON payload that you send to your webhook URL will contain other fields in addition to text . Here’s a more advanced HTTP request example that you can use with the same webhook url that you used above:
This example uses message attachments, message buttons and menus, and some additional formatting fields. You can also use the Message Builder to preview and test your message JSON before you send it.
We also have some fantastic docs that explain how to make your messages more interesting and interactive, so please dive into our guide to Composing Messages.
You cannot override the default channel (chosen by the user who installed your app), username, or icon when you’re using Incoming Webhooks to post messages. Instead, these values will always inherit from the associated Slack app configuration.
Post your message as a reply in a thread
You can add the thread_ts parameter to your POST request in order to make your message appear as a reply in a thread:
For more info on threads, check out our guide to threading messages.
Generating Incoming Webhook URLs programmatically
In the guide above we showed you how to quickly generate a webhook URL through your app settings UI, but when you’re distributing your app (for use by non-collaborators), you’ll need a way for it to generate those URLs on the fly.
Fortunately, Incoming Webhooks can be easily generated during the standard OAuth install flow. If you are going to distribute your app, it’s likely you were already going to use the OAuth process anyway (if you’re building a Workspace app see the note below), so we’ll just cover the adjustments you’ll need to make.
1. Change your scopes
As part of the install process, your app defines a set of initial permission scopes to request from a user. Whether you’re using the Slack button to provide a link for users to install your app or your own custom OAuth redirect, there will be a scope parameter that sets this initial list of permissions.
To generate Incoming Webhook URLs, make sure you include the incoming-webhook permission in that scope list. When you do, users will see an additional permission on the Authorize screen that lets them pick the channel where Incoming Webhooks will post to, as shown above.
2. Grab Incoming Webhook URL from the OAuth Response
Once a user installs your app, and your app has completed the OAuth verification code exchange, you’ll receive a JSON response like this:
You can see that this OAuth response contains an incoming_webhook object, and right there in the url field is your brand new Incoming Webhook URL. You can now go ahead and use this URL to post a message, as demonstrated above. Here’s a full explanation of all the fields in this incoming_webhook object:
Workspace Apps and Incoming Webhooks
As mentioned, you can’t use Incoming Webhooks with Workspace Apps. Instead, those apps can request single channel write access and then use chat.postMessage in the Web API to post messages, providing very similar functionality to Incoming Webhooks.
Though in most cases you’ll receive a "HTTP 200" response with a plain text ok indicating that your message posted successfully, it’s best to prepare for scenarios where attempts to publish a message will fail.
Incoming webhooks may throw errors when receiving malformed requests, when utilized webhook URLs are no longer valid, or when something truly exceptional prevents your messages from making it through to channels and users.
Incoming webhooks return more expressive errors than our Web API, including more relevant HTTP status codes (like "HTTP 400 Bad Request" and "HTTP 404 Not Found"). These are described in our changelog: Changes to errors for incoming webhooks.
Common errors you may encounter include:
- invalid_payload typically indicates that received request is malformed — perhaps the JSON is structured incorrectly, or the message text is not properly escaped. The request should not be retried without correction.
- user_not_found and channel_not_found indicate that the user or channel being addressed either do not exist or are invalid. The request should not be retried without modification or until the indicated user or channel is set up.
- channel_is_archived indicates the specified channel has been archived and is no longer accepting new messages.
- action_prohibited usually means that an admin has placed some kind of restriction on this avenue of posting messages and that, at least for now, the request should not be attempted again.
- posting_to_general_channel_denied is thrown when an incoming webhook attempts to post to the "#general" channel for a workspace where posting to that channel is 1) restricted and 2) the creator of the same incoming webhook is not authorized to post there. You’ll receive this error with a HTTP 403.
- too_many_attachments is thrown when an incoming webhook attempts to post a message with greater than 100 attachments. A message can have a maximum of 100 attachments associated with it.