Splio Sync Magento 2

1.Installation guide

1.1.Extension installation

Before the extension install, it must be ensured that the Magento environment is properly configured.

Please feel free to check among other topics:

1.1.1.Through composer

  1. Place an order for the extension through the Magento marketplace.
  2. Open a terminal and run the following command in your Magento directory:
    $ composer config repositories.private-packagist composer https://home-made-io.repo.packagist.com
    $ composer require home-made-io/splio-sync-m2
    $ bin/magento module:enable Silex_NewsletterApi
    $ bin/magento module:enable HMio_SplioSync
    $ bin/magento setup:upgrade
    $ bin/magento cache:clean
  3. If Magento runs in production mode, you also must compile and deploy the extension’s static files:
    $ bin/magento setup:di:compile
    $ bin/magento setup:static-content:deploy

1.1.2.Through the Magento admin panel

  1. Place an order for the extension through the Magento marketplace.
  2. Go in Magento admin, menu System > Tools > Web Setup Wizard.
  3. Click the Extension Manager icon.
  4. Within the Magento Marketplace Account section, click on New Purchases, and follow the instructions to install the extension.

The extension installation must be relatively quick (under 5 minutes). If this delay is exceeded, please check the log files.

1.2.Extension uninstallation

Open a terminal and run the following commands in your Magento directory:

$ composer remove home-made-io/splio-sync-m2
$ composer remove simonlx/newsletter-api
$ composer config --unset repositories.private-packagist
$ bin/magento setup:upgrade
$ bin/magento setup:di:compile
$ bin/magento setup:static-content:deploy
$ bin/magento cache:clean

2.User guide

2.1.Overall functioning

The Splio Sync extension for Magento 2 allows the synchronization of the customers, the newsletters subscribers, the abandoned carts and the orders between Magento 2 and Splio.

It synchronizes the following data of these antities :

  • customers and newsletter subscribers: ID, email, names, gender, date of birth, phone number, VAT number, creation, last update, last connection and last synchronization date
  • billing address of customers: address lines, city, zip code, country, company
  • abandoned carts and orders: ID, store, totals in base and locale currency, creation and last update date
  • abandoned carts or orders items: SKU, price, ordered quantity, totals in base and locale currency
  • products linked to the items: names and descriptions in every locale used in your Magento instance, prices in every currency used in your Magento instance, brand, image, URL, stock level, categories, creation, last update and last synchronization date

The synchronization is done in almost real-time (less than a minute of delay), by adding non invasive synchronization tasks in a dedicated queue, and processed by a cron task.

The Splio Sync extension for Magento 2 also allows the synchronization of customers and newsletter subscribers as requested by GDPR.

2.2.Extension configuration

2.2.1.API key addition

Go in Magento admin, menu Stores > Configuration, then in the tab Splio Sync > API.

In the configuration field API key, place the API key displayed in the Splio admin interface.

You can check the proper functioning of the connection to the API by clicking on the button Test connection.

In case of error, feel free to copy the error message displayed and send it to the email address contact@home-made.io.

For more information on the API keys generation on Splio, please look at the dedicated documentation.

2.2.2.Splio multiple universes management

It’s possible to configure the extension to synchronize the abandoned carts of different websites on different universes in Splio.

To do so, go in Magento admin, menu Stores > Configuration, then in the tab Splio Sync > API. Then, change the scope to choose the website that must be synchronized in another Splio universe.

It’s a pretty advanced configuration, which has impacts on the synchronization process. Please feel free to talk about it at your contact within Splio in the first place.

2.2.3.Custom fields installation

Splio uses custom fields to save the most data possible on your contacts.

The installation is done by clicking on the button Install the custom fields in Magento admin, menu Stores > Configuration, then in the tab Splio Sync > API.

In case of multi-universes configuration, the custom fields will be created automatically on each of the universe configured. If an universe is added in the configuration during the lifetime of the website, it’s necessary to rerun the custom fields installation the same way.

The installation through the button does not delete the custom fields already existing, nor does it create duplicates. You can click again on the button without fear of impacts in the data existing in Splio.

The extension offers a list of custom fields already made. As for now, it’s not possible to change it without the intervention of a third party, who has access to the code and the database of Magento 2, through the inclusion of the extension override.

Here is the complete list of custom fields created by the extension:

  • For the contacts: Magento ID, prefix, gender, VAT number, date of birth, zip code, city, country, et company of the default billing address, activation status, Magento store identifier, creation, last update, last connection and last synchronization dates
  • For the products: Splio ID of the parent product, name and description in each locale used, URL, price in each currency used, stock level, creation, last update and last synchronization dates
  • For the orders and carts: Locale currency, totals in the locale currency, last update
  • For the oarders and carts items: Locale currency, totals in the locale currency

Feel free to consult your contact within Splio to obtain information about the development of the modification system of customs fields.

2.2.4.Contacts lists

You can choose from the configuration panel in which Splio lists your contacts will be synchronized :

  • Email optins: You can choose the list gathering all you customers which are also newsletter subscribers in Magento
  • All contacts: You can choose to synchronize all your Magento 2 customers in a specific lists in Splio

Warning: if you have several Splio universes configured for a you Magento 2 websites, please be sure to configure the lists accordingly.

2.2.5.Choice of identifier attributes

Two last structuring choices are to be made before the launch of the first synchronization.

For the products and the contacts, the extension allows users to choose which will be the attribute identifying the entity in Splio, among the list of attributes existing in the Magento 2 website.

For the products, the favored choices are the SKU and the Magento ID. For the contacts, the email address or the Magento ID. Nonetheless, any other attribute can be used.

If none of the favored attributes suit your context, here is the important points to take into account for choosing the identifier attribute

  • it must be filled for all products or customers
  • it must be unique for each product or customer
  • it must be defined globally, so no overridden at website / store scope
  • it must be saved as a text or as an option of a list

Feel free to consult your contact within Splio to define what is the best choice for you.

Once the synchronization is launched, it’s strongly discouraged to change the identifier attribute. The configuration fields are disabled once the synchronization is launched.

2.2.5.1.Customer identifier attribute

Splio allows users to identify contacts with the email address, the phone number or any custom fields defined in the universe.

The phone number is rarely filled out within an ecommerce website. So the extension handles three hypotheses regarding the contacts’ identification

  • the contacts are identified in Splio by their email address: The email address is sent at Splio, being a default field.
  • the contacts are identified in Splio by their Magento ID: A custom field called m2_customer_id synchronizes the Magento ID of the customer. Besides, this custom field is filled out whatever the identifier attribute.
  • the contacts are identified in Splio by other data existing in Magento: it can be an external ERP ID saved in Magento, a VAT number, etc… In this case, it is mandatory to create a custom field in Splio, then to save within the configuration the ID and the name of the custom field, both of them being mandatory to the synchronization. To do so, go into Magento admin, menu Stores > Configuration, then in the tab Splio Sync > Contacts, and fill the configuration fields as such.

2.2.6.Stores configuration

Before configuring the extension to synchronize the abandoned carts, you must create the store which will receive the carts within Splio.

Go in Splio, in the menu Data > Sales data, then in the tab Stores, and create one or more stores matching the stores in the Magento website.

The Splio Sync extension allows synchronizing the abandoned carts in a Splio store depending on the website or the store view on which it has been made. So you can create as many stores in Splio as there are store views in Magento, or only one store containing all abandoned carts existing in your Magento instance.

Once the stores are created in Splio, you can fill out their external ID in the configuration field of the Splio Sync extension.

Go in Magento admin, menu Stores > Configuration, then in the tab Splio Sync > Abandoned carts.

In the configuration field called Splio store external ID, fill out the external ID of the Splio store newly created.

By modifying the scope of the configuration, you can change the external ID of the Splio by website or store view.

2.2.7.Order states synchronization

You can choose which states orders are synchronized with Splio.

By default, only orders in « processing » states are synchronized.

2.3.Launching of the synchronization

After the configuration step, you can launch the synchronization.

To do so, go into Magento admin, menu Stores > Configuration, then in the tab Splio Sync > Job Queue, and change the value of the configuration field called Enable sync between Splio and Magento.

After that, for each entity synchronizable (at the time, only the abandoned carts), go in the matching tab, and change the value of the configuration field called Enable export.

2.3.1.Existing entities synchronization

Go into Magento admin, menu Stores > Configuration, then in the tab Splio Sync > API.

In the fieldset « Initialization » you’ll find 3 buttons to synchronize all existing data in Splio.

Warning: This operation can slow down the speed of the others entities during a few moments.

2.4.Synchronization tracking

Into the menu System > Splio, several pages display information on the smooth running of the synchronization of the different entities.

2.4.1.Jobs tracking

Into the menu System > Splio > To Splio Job Queue, a grid displays the list of the jobs to be done to Splio, with their status, creation date and a potential error message. 

The jobs can be in one of the following statuses:

  • pending
  • running
  • in error
  • skipped: the entity’s data indicates that it must not be synchronized
  • finished

The jobs finished or skipped are automatically deleted after their processing.

In case of error, the synchronization process try to rerun the job 4 times, before giving up. The jobs definitively in error stay visible in the grid, with the error message matching.

2.4.2.Entities matching

2.4.2.1.Matching of the contacts (customers and subscribers)

Into the menu System > Splio > Contacts synchronized, a grid displays the list of the contacts synchronized with Splio, a contact being either a customer or a NL subscriber, or both obviously. It includes the customers / subscribers deleted in Magento 2.

2.4.2.2.Matching of the abandoned carts

Into the menu System > Splio > Abandoned carts synchronized, a grid displays the list of the abandoned carts already synchronized with Splio, including those which have been deleted since (because they were converted as orders, or deleted by the customer).

2.4.2.3.Matching of the orders

Into the menu System > Splio > Orders synchronized, a grid displays the list of the orders already synchronized with Splio.

2.4.2.4.Matching of the products

Into the menu System > Splio > Products synchronized, a grid displays the list of the products synchronized with Splio.

In Magento, products can be affected to several websites, thus synchronized with several universes in Splio. The column Scope allows to determine with which it has been synchronized, and with which identifier.

2.4.3.Logs tracking

The extension offers two pages for tracking the smooth running of the synchronization into the menu System > Splio, Logs and API calls logs.

The first page displays information of the running of the synchronization of the different entities. The second one displays the calls made to the Splio API during the synchronization.

Authentication calls to the Splio API are never logged, for security purposes.

Those are primarily technical data, but which are very useful during errors resolution.

Nonetheless, you can choose to disable a part of logs (the least critical) in order to avoid populating the matching table in your database needlessly.

By default, logs are deleted after 7 days, and duplicated in a dedicated log file. The configuration allows modification of these behaviors nonetheless.

In case of error, feel free to send us the information contained in the matching tables, to ease the resolution of the issue.

2.5.Synchronization specificities

2.5.1.Abandoned carts synchronization

2.5.1.1.Delay before synchronization

The extension allows defining a delay before considering a cart as abandoned.

By default, this delay is valued at 36 hours.

2.5.1.2.Abandoned carts' products synchronization

The extension synchronizes only simple products (at the moment). If one of the products synchronized are a variation of a configurable product, or a part of a grouped product, the ID of the parent product will be saved in the custom field m2_parent_id, created by the extension.

2.5.1.3.Base and locale currency

The module send in Splio the totals in base currency in Splio. Meaning that the locale currency totals are send as custom fields, for the cart and its items.

As for now, custom fields of carts items are not displayed in Splio admin UX, but rest assured that the totals are also sent in locale currency for carts items.

2.5.2.Abandoned carts deletion

When a cart is transformed in an order, deleted by the customer, or considered as inactive by Magento, the extension synchronizes its deletion in Splio, if the cart was previously synchronized.

2.5.3.Orders synchronization

2.5.3.1.Matching cart deletion

When an order is synchronized with Splio, if the matching cart in M2 was already synchronized with Splio, it will be deleted first, as the order ID is different of the previous cart ID.

2.5.4.Subscribers unsubscription

In compliance with GDPR, when a subscriber unsubscribe from you newsletter, if the contact list are correctly configured, the extension synchronizes its removal from the email optin contacts in Splio.

If the then-subscriber was only in the list configured in Magento 2 as the list gathering all email optin contacts, it will be removed from this list nonetheless, leaving it in no list in Splio.

If the then-subscriber was not linked to a customer, its unsubscription will be synced as a deletion in Splio.

If the module is configured to use a identifier attribute other than the email, and if the subscriber is not linked to a customer, and if it was not already synced with the module, there’s no way the module can know which contact it has to remove from the email optin list.

2.5.5.Customers deletion

In compliance with GDPR, when a customer deletes its account, the extension synchronizes its deletion from the email optin contacts in Splio.

As for now, the deletion will only be effective if the customer was created by the module in the first place. This restriction will be removed in the next release of the module.

3.Reference manual

3.1.Synchronized data mapping

The extension use the API given by Splio. The names of the fields below refers to fields expected by the API. See here for more information.

3.1.1.Contacts

3.1.1.1.Standard fields

Splio field nameMagento 2 dataComment
lastnamelastname
firstnamefirstname
creation_datecreated_at
languagelanguage code from the value of the configuration field « general/locale/code » in the store of the abandoned cart« fr », « en », « es »…
emailemail
cellphonephone number of the customer’s default billing address
lists« 0 » and the value of the configuration field « splio_sync_contacts/newsletter/list_id » for the website of the abandoned cart[0] or [0, x]

3.1.1.2.Custom fields

Here is the list of the custom fields used by the addon for customers / contacts

Splio field nameMagento 2 dataData typeComment
m2_customer_identity_idint
m2_prefixprefixtextMr, Mme…
m2_gendergendertext« F », « M » or « N/A »
m2_taxvattax_vattextVAT number
m2_dobdobdateDate of birth
m2_storeValue of the configuration field « splio_sync_carts/export/store_id » in the store of the abandoned carttext
m2_default_address_zipcodepostcode of the default billing addresstext
m2_default_address_citycity of the default billing addresstext
m2_default_address_country_codecountry_id of the default billing addresstextIn the ISO 3166-2 standard
m2_default_address_companycompany of the default billing addresstext
m2_statusUnused
m2_last_sync_atCurrent datedate
m2_created_atcreated_atdate
m2_updated_atupdated_atdate
m2_last_loginlast_login_atdate

3.1.2.Products

3.1.2.1.Standard fields

Splio field nameMagento 2 dataComment
external_idValue of the configuration field « splio_sync_products/general/identifier » in the store of the abandoned cartDefault value: entity_id
namename
descriptionshort_description
brandbrand
priceprice_incl_tax of the parent product if configurable, of the product otherwise
skusku
img_urlproduct_small_image URL in the store of the abandoned cart
categoryConcatenation of the categories names« Man, Shoes, Sales »

3.1.2.2.Custom fields

Here is the list of the custom fields used by the addon for products

Splio field nameMagento 2 dataData typeComment
m2_parent_identity_id of the parent product, if it existstext
m2_name_*Name of the product for each locale used in API-defined scopetextEx: m2_name_fr_fr, m2_name_en_us
m2_description_*Short description of the product for each locale used in API-defined scopetextEx: m2_description_fr_fr, m2_description_en_us
m2_url_pathurl_pathtext
m2_price_*Price of the product for each currency used in API-defined scopetextEx: m2_price_eur, m2_price_usd
m2_inventory_levelInventory leveldoubleWorks with or without MSI
m2_created_atcreated_atdate
m2_updated_atupdated_atdate
m2_last_sync_atCurrent datedate

3.1.3.Abandoned carts

3.1.3.1.Standard fields

Splio field nameMagento 2 dataComment
external_id« m2_cart_ » followed by the entity_id of the cartm2_cart_2547
contact_idSplio ID of the contact, given the value of the configuration field « splio_sync_contacts/general/identifier » in the store of the abandoned cartThe customer ID, email address, or any other attribute defined in the configuration
store_external_idValue of the configuration field « splio_sync_carts/export/store_id » in the store of the abandoned cart
ordered_atcreated_at
discount_amountbase_discount_amountIn base currecny
shipping_amountbase_shipping_amountIn base currecny
total_pricebase_grand_total + base_tax_amountIn base currecny
tax_amountbase_tax_amountIn base currecny
completedfalse
currencybase_currency_codeBase currency, ISO 4217 format

3.1.3.2.Custom fields

Here is the list of the custom fields used by the addon for abandoned carts / tickets.

Splio field nameMagento 2 dataData typeComment
m2_locale_currencyquote_currency_codetextISO 4217 format
m2_locale_discount_amountCartTotalRepository discount amountdoubleIn locale currency
m2_locale_tax_amountCartTotalRepository tax amountdoubleIn locale currency
m2_locale_shipping_amountCartTotalRepository shipping amountdoubleIn locale currency
m2_locale_grand_totalCartTotalRepository grand total + tax amountdoubleIn locale currency
m2_updated_atupdated_atdate

3.1.4.Abandoned carts items

3.1.4.1.Standard fields

Splio field nameMagento 2 dataComment
unit_pricebase_price_incl_tax of the parent product if configurable, of the product otherwiseIn base currency
quantityqty of the parent product if configurable, of the product otherwise
discount_amountbase_discount_amount of the parent product if configurable, of the product otherwiseIn base currency
tax_amountbase_tax_amount of the parent product if configurable, of the product otherwise
total_line_amountbase_row_total_incl_tax of the parent product if configurable, of the product otherwiseIn base currency
product_idProduct Splio ID, given the value of the configuration field « splio_sync_products/general/identifier » in the store of the abandoned cart

3.1.4.2.Custom fields

Here is the list of the custom fields used by the addon for abandoned carts items.

Splio field nameMagento 2 dataData typeComment
m2_locale_currencyQuote locale_currency_codetextISO 4217 format
m2_locale_unit_priceprice_incl_tax of the parent product if configurable, of the product otherwisedoubleIn locale currency
m2_locale_discount_amountdiscount_amount of the parent product if configurable, of the product otherwisedoubleIn locale currency
m2_locale_tax_amountCtax_amount of the parent product if configurable, of the product otherwisedoubleIn locale currency
m2_locale_total_line_amountrow_total_incl_tax of the parent product if configurable, of the product otherwisedoubleIn locale currency

4.Subscribers synchronization

If the module is configured to use a identifier attribute other than the email, if a newsletter subscriber is saved, it only ill be synchronized if it’s linked to a customer with the identifier attribute filled.

Suggérer  de  modifier