Skip to content

Mailchimp Guide (part 3) Sync Ecommerce Data

Gonzalo Dominguez edited this page Jul 12, 2022 · 1 revision

Using Mailchimp in Magento 2

Part 3 - Syncing your Ecommerce Data

So far we have seen how to install and set the extension correctly to sync our Magento Subscribers, in this 3rd part we're going to focus on how to set the extension to Sync all our Ecommerce data. The Ecommerce data are Products, Orders, Customers and Abandoned Carts.

First thing to bear in mind is that EVERY part of this Syncing process is done through Batches and via Cron jobs, so you will need to set your Magento Cron jobs correctly.

([https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-cron.html]{.underline})

To begin with, we have seen in previous articles that we need to have our Magento Store connected to a Mailchimp Store, once this is done we need to enable Ecommerce Configuration in the Mailchimp for Magento Settings.

To do so, we have two sections, one for Ecommerce:

image

And other for Abandoned Carts:

image

Let's start with Ecommerce:

When we enable this setting, the extension will start syncing every Product, Orders and Customers, and, in case we enable it, every Promo Code and Promo Rule.

First thing we see is that we can Subscribe all of our customers to the List(Audience), this must be done carefully, since every Customer will be sent to the list as a Subscriber regardless, this means they will never receive a Double Opt-In email.

What happens when I enable this setting then? When a customer gets synced to the Mailchimp List, it will generate a webhook that is gonna notify Magento that this Customer has turned into a Subscriber, and after a while will also update as a subscriber in Magento.

The second thing we see is a 'First Date' field, if we specify a Date there, then only the Orders with date newer than the one we selected will get synced to Mailchimp.

This is useful for when the Magento Store has existed for a long time and syncing all existing Orders does not make much sense or when the quantity of Orders is large and syncing those would have an extremely high cost.

Here we have to consider that the Orders in Mailchimp appear with the date when they were synced and not the real date of the order, this is surely a disadvantage when trying to check revenues by date, but unfortunately our extension can't do anything about it.

The third thing we see is a flag that indicates if the Product prices will include or not Taxes, this depends on our Magento Configuration and it's simply so prices sync correctly to Mailchimp.

Syncing orders also mean syncing products, so both sync at the same time.

At first 100 products and 100 orders each time the cron job runs, with the exception that if an order contains a product that has not yet been synced, then that product gets added to the syncing process so the order does not fail.

Which products get synced? All Simple, Virtual, Downloadable and Configurable products. It doesn't matter if an order contains that product or not, it will get synced regardless.

This means that the Bundled, Grouped, Gift Cards and 'Custom Type' products do not get synced.

We are looking into finding a solution for Grouped and Bundled products, but it will take time.

So, if not all products are synced, what happens when an order contains one of those non-supported products? Here can take place two cases:

  1. If the order contains other products that are supported, then the

    non-supported product will get excluded from the order, the totals of the order are the real totals, but the information of the order doesn't contain the non-supported product, as it has not synced.

  2. If the order only contains non-supported products then the order is

    marked as 'With Error', and does not sync to Mailchimp since it does not support orders without any lines of Information.

In the Magento Order Grid we can see an icon that indicates the Syncing Status for each order.

image This means that the order has yet to be synced.

image This means that the order was processed by the Cron job but it found an error before being sent and it is not going to sync. (for example, the order only contains non-supported products)

image This means that the order was sent to Mailchimp and is waiting for the result of that Sync.

image This means that the order has synced to Mailchimp successfully.

image This means that the order has been synced but Mailchimp rejected it. (for example, the product does not exist in Mailchimp)

image This means that the Order, once synced, has been modified and must be re-synced. (for example, the order was shipped)

In case there is an error (second and fifth option) we can find a description of the error by moving the cursor over the icon (from version 1.x.37 onwards), and an entry in the Error Grid that we'll see later.

While syncing our Magento Store for the first time, we can check the Account Details and see that the 'Account Synced' field appears empty.

image

And when the store finishes syncing, a date will appear.

image

We have to consider that until the store isn't fully synced there are Mailchimp features that won't work, for example, basically any automation.

What is an automation? An automation is basically a special Mailchimp Campaign.

There are several predefined automations, we just need to go to Mailchimp > 'Connected Sites'.

image

This will lead us to a page where we are going to see all our Mailchimp Stores and select one.

image

Once there we can see that our Mailchimp Store is connected to a Magento2, we can also see the Syncing Date (the same date we can see in the Magento Admin), and we can choose between all our Mailchimp Stores.

As we can see, the most common things we may want to first set are found here.

image

We are going to check Order Notifications in particular first.

We can find two sections:

image

Here we can change who receives the Notification. (It refers to Customers of a specific Mailchimp Store)

Who Sends the email. (By default, the owner of the List)

And, we can see that the Emails are not yet enabled to be sent.

Afterwards we have a section where we can choose which emails we want to send, for example, when the order is created, when the invoice is created, etc.

image

image

Once we enable any of these the emails will start being sent.

image

Remember this icon? image

Whenever an invoice is created, then the order gets marked as modified and to resync, if we check the Magento Order Grid after this we can see that icon appear, and when it gets synced, if we have selected the Notification to get sent for invoices then the Mailchimp automation will trigger and send the email. This will happen not only with the Invoice, but with the Shipping, Credit Memo, etc, which means that if we modify the order it will resync, and that can trigger a Mailchimp Automation if it has been set.

image

What can't we edit here?

Unfortunately, if we go to 'Edit Design' for these automations, we will be able to change some things but not others, for example, you can't change the Language of the Order Details in case that you want, there is no way of changing it.

In the next Part we will learn how to set Abandoned Carts.