There are different ways to integrate the plug-in into your Magento store. There is a possibility to use the marketplace and the possibility to integrate the plug-in via the composer. The composer is preferred since it’s easier to update to newer versions and troubleshoot problems using the command-line interface (CLI). Next to that, the latest plug-in versions will first be available on GitHub, so it’s possible the marketplace does not have the most recent version. If possible, it’s highly recommended to use the composer.
After installing the plug-in, a few steps have to be taken into account. These will be described below.
First, head to your Magento back end to stores -> configuration -> Datatrics plug-in.
1. The first step is to check if the configuration has been done correctly. You can do this by clicking on the blue button “perform testing.”
A self-test will now appear on your screen. If everything is set up correctly, all checks pass
If not all checkmarks are green, additional steps should be taken for the plug-in to function correctly.
1.1 If the PHP version is not supported, this should be updated for the plug-in to work. The minimal requirement is PHP 7.1.
1.2 If the cron job is not running, this should be enabled. The cron job can be enabled in the general global settings.
1.3 When the Magento version is not supported, there is, unfortunately, no way of using the plug-in. The version should be at least 2.3.
1.4 When there is a new version of the plug-in available, please install and update the version. The latest version has the newest updates, which will make the integration more efficient. You can follow this link to download the latest version.
2. Always have an accurate API key and projectid filled in within your plug-in settings.
After filling in the correct id and API key, click on the grey button to validate the credentials.
3. When you have multiple projects within Datatrics, you need an API key that has access to all projects. Changing the projectid and source name per store view is also essential. If you don’t set this up correctly, it will cause issues when importing the data.
In the top right corner click on the dropdown under scope → change into the right storeview. See screenshot below.
Afterwards, you can change the settings of the plug-in per storeview.
3.1 When you have one project and multiple store views, changing the scope per store view and adjusting the configuration per store view is still imperative. If you don’t alter this, it will cause issues with importing the correct data and content.
4. When the above is set up correctly, the sales and profile data will likely be synced to Datatrics correctly. If necessary, you can still configure the type of orders and profiles you would like to synchronize. When checking the Datatrics platform, you should see the profiles within the audience section. It can take up to several hours before the segment is visible in the front end of Datatrics
5. For the content section, you can set all the preferred fields per store view that you wish to synchronize to Datatrics. You can also add extra fields. Do take note that these fields need to be available in the catalog. If the fields are custom or an array/measurement of different fields, the plug-in won’t be able to synchronize them. You should then look into other options to use.
5.1 After all the desired fields have been configured, you can invalidate all the items and update them.
Update all invalid items:
When successful, you will see a checkbox with how many items have synced:
5.2 If this has not been performed correctly, or not all items have been updated, it could be due to the processing limit. You can change this at the top of the content section:
The above is dependent on the amount of product you have within your catalog.
5.3 If you are updating the items, and you see a white page or nothing happening. The best way to troubleshoot this is by using the CLI.
You can manually update the items via the CLI using the following code:
It’s essential that you also set the storeid of your Magento store. You can find this in the last part of the URL when changing the store view:
6. The last part of the Magento plug-in is tracking. Tracking is automatically enabled when you configure the plug-in.
When you don’t have any tracking activity on your website, these settings can stay enabled. However, if you already have tracking on your website, for example, via Google Tag Manager (GTM), this will cause conflicts. The best way to go is to deactivate the tracking in either the plug-in or in GTM. Only one form of tracking can be active at one time.
Furthermore, if you use a one-page application, or a progressive web app, the standard tracking of the Magento 2 plug-in won’t suffice. You will then need to implement the tracking via GTM. You can read more information about that here.
When all the above steps are completed, the plug-in should run successfully on your website.