From platform it is possible to send the metadata via API to the Mailchimp account in order to perform content segmentation and send in this case mass mailings to a certain group of people, the data delivered is the one corresponding to the module Customers>Customers, for this reason, the registration fields must match the metadata requested during the configuration.
How to integrate mailchimp in platform:
1- Go to the Settings>Integrations module, the integration must be commercially active, in the module it will look like this:
Platform requires for activation the following information from the Mailchimp account:
Token (API key)
Server Prefix
List ID
2- The data is obtained from the user's mailchimp account as follows:
Token: Click on the user's profile and go to the Extras menu, where you will find the Api Key section.
Once inside the section, and if you do not have a previously created api key, click on the option Create a key, this immediately opens an interface where the name of the key is requested, just type the desired name and indicate Generate Key.
The following screen will only be visible once, therefore the key provided must be copied and saved immediately, as it is totally blocked.
Once the key is copied, assign it immediately to the Token section in platform.
Server Prefix: this is obtained from the token itself, and is equivalent to the last 4 characters after the hyphen or, to the first 4 characters that you see from the browser on the mailchimp website.
List ID: This is obtained from the Audience>All contacts section, generally the interface will be empty, but this is already part of the required integration and the segmentation that you want to do, within the interface, we must go to Settings and there enter the first option Audience name and default values:
Once you enter, the Audience ID, unique to each account, will be displayed.
With the mailchimp data ready, we just need to activate the integration and save the module changes.
When mailchimp is active, the corresponding webhook must be activated by selecting the modules to be segmented, by default the customer and purchase data.
The configuration of the segmentation within the mailchimp account corresponds directly to the client and its needs.
Data mapping between Mediastream Platform and Mailchimp
This section explains how Mediastream Platform maps the data of your models to match the data model required from mailchimp for a correct registration.
Members
Corresponds to what in platform would be the Customers collection, here the audience members are added or updated.
Api Point:
/lists/${audienceId}/members/${customer.email}
Mailchimp Field | Platform Customer Field |
email_address | |
status_if_new | “subscribed” |
status | “subscribed” |
merge_fields.BIRTHDAY | birthday (en formato mm / dd) |
merge_fields.FNAME | first_name |
merge_fields.LNAME | last_name |
merge_fields.GENDER | gender |
merge_fields.PHONE | phone |
merge_fields.STATUS | status |
merge_fields.DATE_C | date_created |
merge_fields.PAYMENT_C | payment_count |
merge_fields.PURCHASE_C | purchase_count |
merge_fields.ADDRESS_1 | address_line1 |
merge_fields.ADDRESS_2 | address_line2 |
merge_fields.CITY | address_city |
merge_fields.STATE | address_state |
merge_fields.COUNTRY | address_country |
tags | address_country (lowercase) |
* The values enclosed in quotes do not correspond to data but to a string..
Store
This collection allows you to add or update customers in mailchimp. The store of each customer corresponds to the following id, mediastream-store-{account-platform} this is created when connecting Mediastream Platform with Mailchimp and records are inserted with the following structure:
Api Point:
/ecommerce/stores/mediastream-store-${account_id}/customers/${customer.id}
Mailchimp Field | Platform Customer Field |
id | _id |
email_address | |
opt_in_status | false |
first_name | birthday (en formato mm / dd) |
last_name | first_name |
address.address1 | address_line1 |
address.address2 | address_line2 |
address.city | address_city |
address.province | address_state |
address.country | address_country |
Products
In this collection the products to segment in mailchimp are stored, it is important to consider that the products are updated on the store mentioned above. What we do to update or create is that in each purchase that is made we obtain the necessary metadata to make the update. Thus we have:
Api Point:
/ecommerce/stores/mediastream-store-${purchase.account}/products
Mailchimp Field | Platform Purchase Field |
id | product.id |
title | product_name |
type | type |
variants | [{ id: product_id, title: product_name }] |
Orders
This is where all purchasing operations are managed, the mapping is done with the Platform purchases collection..
Api Point:
/ecommerce/stores/mediastream-store-${purchase.account}/orders
Mailchimp Field | Platform Purchase Field |
id | _id |
order_total | product_name |
currency_code | type |
customer | [{ id: product_id, title: product_name }] |
lines | [{ product_variant_id: product_id, product_id: product.id, id: _id, price: amount, quantity: 1 }] |
billing_address.country | metadata.origin_country_name |
billing_address.country_code | metadata.origin_country |
If you have any related questions please feel free to write to us via chat.
Atte. The Mediastream Team