new email

Email marketing is one of the best ways to stay in touch with your customers and build a strong brand image. Magento comes with a set of built-in tools, like email templates, to manage your campaigns. However, they aren't always enough for the ultimate results.

The Magento 2 Mautic Integration offers an efficient solution that allows you to synchronize Magento contacts with Mautic. As a result, you can create better segments and more targeted email campaigns. 

Before we get to that part though, you need to configure the integration first. So, navigate to Stores > Configuration > Magefan Extensions > Mautic integration and configure the required sections.

General Settings

To begin with, you have to fill out the basic details. Navigate to the General section and take the following steps.

1. Enable the extension and enter the product key.

2. Specify the Mautic URL.

3. Choose the Authentication Method.

4. Specify Mautic Login and Password.

5. Enter some random characters in the Webhook URL Secret Key field and use the below link for webhook settings in Mautic:

https://mautic.demo.magefan.top/mfmi/mautic/webhook?secret=juBG92Bizf6kHuSF7nY0jJJhPQnohUSu
magento 2 mautic integration general

Note: You need to enable the Mautic API and HTTP basic authentication.

At this point, you can hit the Save Config button to proceed with the configuration. We'll get back to the Export All Contacts button later once all the sections are filled out.

Mautic Contact Monitoring

In this section, you have to decide whether to Enable JavaScript (JS) Tracking.

By choosing Yes, you enable the Mautic tracking pixel on the storefront. It will gather data about website visitors and store it in Mautic. You can use it for user segmentation later.

mautic contact monitoring magento

Here you can also specify whether to Enable monitoring for Guests or keep it on for the registered users only.

Fields Mapping

Next up, we have the Fields Mapping section. Here you need to match the Mautic Contact Fields with the Magento Customer Fields. The customer information will be placed in the corresponding fields in Mautic contacts based on your mappings.

magento 2 mautic integration fields mapping

The fields are already preset. So just use them as is or remove/add some items to synchronize the right data.

Newsletter Subscription

Magento allows you to ask your customers to confirm the newsletter subscription via email. Just enable the Need to Confirm option in Stores > Configuration > Customers > Newsletter > Subscription Options.

magento subscription confirmation options

With the Mautic Integration, you can disable the Magento subscription confirmation email and emails won't be sent via Magento but via Mautic. It is more convenient since you can manage your contacts in one place and create personalized email campaigns effectively.

Magento Newsletter Subscription Confirmation

Note: Сonfigure the Mautic campaign to send an email, change the contact subscription status field, and Mautic Webhooks, so the subscriber's status changes in both Mautic and Magento.

Once you set all the information don't forget to press the Save button once more.

Contacts Export

At this point, you are good to go back to the General section and press the Export All Contacts button. It will start the synchronization and transfer customer details from Magento to Mautic.

If you have a large customer base, the synchronization may take quite a long time. Thus, try to use the following command to keep the process running in the background:

mfmi:export:all 

Alternatively, divide the export into several stages and synchronize customer data in parts using these commands:

mfmi:export:customers 
mfmi:export:orders 
mfmi:export:reviews 
mfmi:export:subscribers

Troubleshooting

If you notice that the integration is not complete and the field mapping doesn't work properly, it is most likely because of cache.

Try to delete the var/cache folder in the Mautic file system to clear it out, or use this command to clear cache via CLI:

rm -rf var/cache/*

Once done, you should see all customer data in the corresponding Mautic fields. Now, you can start working on your campaigns, segment your customers, and enhance your overall Magento marketing efforts.