Guide to Integrate with Magento 2

If your eCommerce is developed in Magento, you can easily integrate it with Connectif and start collecting data from your customers to create your campaigns.

In this article, you will learn how to install and configure the Connectif module for Magento 2.

 
Implementation time: 15-20 min.
Difficulty: Advanced (requires technical knowledge).
When to use it?: When opening your Connectif account.

 

STEP 1. Download and Installation of the Magento 2 Module

Depending on the version of Magento your eCommerce has, you should follow different steps:

 

A. Versions prior to Magento 2.2

A.1. Download the module

1. Log in to your Connectif account.

2. Go to Store Settings in the left-hand menu.

3. In the E-commerce Platforms section, find Magento and click Edit.

Guia para integrar con Magento 2 Ene 25 - 10-min.png

 

4. In the Configuration section, click on Download Magento 2 Module to download the “connectif.zip” file to your computer.

Guia para integrar con Magento 2 Ene 25 - 11-min.png

 

A.2. Copy the Connectif folder to the Magento installation

5. Copy the folder "Connectif" and all its contents inside the folder "/app/code/", located at the root of the Magento 2 installation.

 

If the folder "/app/code/" does not exist, it must be created.

 

For example, if the Magento 2 installation path is "/var/www/html", you should copy the "Connectif" folder to "/var/www/html/app/code/Connectif".

 

A.3. Module installation

6. Access the Magento 2 admin panel and go to the "System > Web Setup Wizard" section.

 

The Setup Wizard is removed starting from Magento version 2.4.0, so you must enable the integration through commands, which you will find available in point 2b of the installation documentation attached to the "connectif.zip" file downloaded in step 2. Find more information in the Magento documentation.

Magento_Integracion_-_3.png

 

7. In Module Manager, search for the Connectif_Integration module and select Activate.

Magento_Integracion_-_4.png

 

8. Follow the steps indicated by the Connectif module installation and click Next:

  • Readiness Check: in this step, checks related to PHP version, crons, dependencies, and extensions are performed.

Magento_Integracion_-_5.png

 

  • Backup: in this step, a backup of the eCommerce is made prior to the module installation.

Magento_Integracion_-_7.png

 

  • Enable module: in this step, the module activation is performed.

Magento_Integracion_-_8.png

 

B. Versions after Magento 2.2

B.1. Download the module

1. Log in to your Connectif account.

2. Go to Store Settings in the left-hand menu.

3. In the E-commerce Platforms section, find Magento and click Edit.

Guia para integrar con Magento 2 Ene 25 - 10-min.png

 

12. In the Configuration section, click on Download Magento 2 Module to download the “connectif.zip” file to your computer.

Guia para integrar con Magento 2 Ene 25 - 11-min.png

 

B.2. Copy the Connectif folder to the Magento installation

13. Log in to the Magento 2.x store via SSH connection.

14. After a successful SSH login, using the command line (shell), go to the root directory where Magento 2 is installed.

15. Upload the module (as a Zip or tar.gz) to the Magento 2 installation root directory.

16. Unzip the file into a temporary directory.

17. The location to copy the unzipped module must be “app/code/Connectif/”. Create that folder with the following command:

mkdir –p app/code/Connectif/

18. Copy the contents of the unzipped folder into the folder created in the previous step:

cp -R Connectif/* app/code/Connectif/

19. Run the Magento 2 installation command from the root:

php bin/magento setup:upgrade

20. Compile the installed module with:

php bin/magento setup:upgrade

21. Clear the cache with:

php bin/magento cache:flus
 

The module will be installed and visible from Stores > Configuration > Advanced > Advanced. The module will appear in this section in the list of installed Magento modules.

 

STEP 2. Module Activation

  

This configuration is the same for versions before and after Magento 2.2.

22. Go to "Stores > Configuration > " and locate the Connectif configuration.

Magento_Integracion_-_9.png

 

23. In Basic Configuration, select the option Yes in the Activate field, so you can complete the Client ID and Secret Key options.

 

Do not close this tab; you will need it to complete your account information.

Guia para integrar con Magento 2 Ene 25 - 6-min.png

 

24. Go to your Connectif account and, in the "Integrations > Magento" section, copy the Client ID and the Secret Key.

Guia para integrar con Magento 2 Ene 25 - 12-min.png

 

25. Return to Magento 2 and paste them into the corresponding fields.

Guia para integrar con Magento 2 Ene 25 - 7-min.png

 

26. Click "Save Config" to save the changes.

 

 

Success! 
Your Connectif integration with Magento is ready.

  

Once the plugin configuration is complete, it is recommended to verify the correct integration. You can see how to do this in this article.

 


Frequently Asked Questions

Do you have questions about the Connectif module in Magento? Here you will find useful information:

1. What is each section of the Connectif module in Magento for?

The Connectif module in Magento consists of different sections, each serving different functions:

  • Basic Configuration (1): this section is used to configure the basic aspects of your Connectif account in Magento, documented in this article, and to start your strategy.

Guia para integrar con Magento 2 Ene 25 - 8-min.png

 

  • Banners (2): this section is deprecated, since banner format content is configured directly from Connectif.
  

Modal windows and banner content have been deprecated since 2021. In this article, it explains how to migrate them to Connectif.

Guia para integrar con Magento 2 Ene 25 - 2-min.png

 

  • Customer (3): this section allows linking custom contact fields in Connectif with those in Magento. To do this, select one of the contact fields available in the CMS (left selector, Customer Field) and associate it with the ID of the field created in Connectif (right selector, Connectif Field ID).

Guia para integrar con Magento 2 Ene 25 - 3-min.png

 

  • Product (4): this section allows linking custom product fields in Connectif with native fields in Magento. To do this, click on the Select Attribute selector of the field you want to associate (Custom Field 1, 2, or 3) and select the product attribute for that field.

Guia para integrar con Magento 2 Ene 25 - 4-min.png

 

  • Public Urls (5): this section is used to consult the activation URLs of the ServiceWorker and the notification subscription URLs.

These URLs are generated and communicated to Connectif when the module is installed in Magento.

Guia para integrar con Magento 2 Ene 25 - 9-min.png

 

  • Advanced Configuration (5): this section is used to establish certain behaviors of the integration with Connectif:
    • Print only mandatory fields on cart tags?: this option determines whether the Connectif script will collect only the mandatory cart fields (product ID, name, price, and URL). This option helps improve the performance of the cart tag in Magento.
    • Use product variants on cart and purchases?: this option determines if, when Connectif receives the cart product information, it collects the default product or the specific variant.
    • Product image Id: this option determines the image size that Connectif will collect.
    • Notify purchases offline: this option determines if the eCommerce will notify Connectif of offline purchases via API and without web context.
    • Order Status: this option determines the status that purchases must have to be registered via API (offline notifications) in Connectif.
    • Create newsletter subscribers if customer does not exist?: this option allows selecting whether to create the contact in Magento as a newsletter subscriber if they do not exist in Magento when registering or unsubscribing from Connectif.
    • Show product view with proper currency when Connectif verifies the product: this option affects the case where product synchronization is done via web scraping. It allows indicating whether, when Connectif's mechanism visits the website to synchronize/verify a product, it does so in the same currency configured in Connectif.

Guia para integrar con Magento 2 Ene 25 - 5-min.png

 

2. How to activate offline purchase notification (via API)?

  

Notifying offline purchases means they do not have web context, but the notification is done via API asynchronously. If there is a strategy that reacts to the purchase with web content, it will not affect contacts whose purchase is registered via the API.

1. In your Magento account, go to "Stores > Configuration", click on Connectif, and then on Settings.

Magento_Integracion_-_18.png

 

2. Deactivate the Connectif module from the "Basic Configuration > Activate" section by selecting the No option.

Magento_Integracion_-_19.png

 

3. Click Save Config.

 

You must save the configuration immediately after this step to be able to activate offline purchases.

4. Go to the "Advanced Configuration > Notify purchases offline" section, and select the Yes option.

Magento_Integracion_-_20.png

 

5. In the "Order Status" section, choose the status that purchases must have to be registered offline in Connectif.

  

The status selection depends on the payment method, Magento configuration, and business model. Only one status can be selected.

Magento_Integracion_-_21.png

 

6. Reactivate the Connectif module from the "Basic Configuration > Activate" section by selecting the Yes option.

Magento_Integracion_-_22.png

 

7. Click Save Config.

 

3. How to configure Connectif in a multi-language Magento store?

Magento allows creating three levels of entities in an account:

  • Website: usually there is only one, corresponding to the domain.
  • Store: the different store(s), for example, by language.
  • Store view: other details for stores, for example, the same language but different currency.

The Connectif module can be configured at any of these levels according to the eCommerce needs, but some aspects must be considered:

  • Magento configuration types, since if configured in "Default" mode, the settings will apply to all Magento levels.
  • To send data from different Magento levels to the same Connectif store, the same Client ID and Secret Key must be used in the configuration.
  • It is recommended, except in very complex cases, to activate the default configuration at the time of integration to configure all levels the same way.

If you have multiple languages and/or currencies you want to configure, it is common to make the article adjustments at the Store View level separately.

Group 2-min.png

 

4. How to recover abandoned carts with the Cart Recovery URL

(This section explains how the Cart Recovery URL works to obtain the items associated with a specific cart).

Through the integration with Magento, a Cart Recovery URL is sent to Connectif, that is, a link to recover the items related to that cart, which can be used in workflows and content.

To obtain the cart recovery URL through a workflow, it must be done via the "Get last cart" and "On cart abandonment" nodes, then mapped in the variables of the content to display or send.

  • Learn how this URL works in different CMS and how to use it in this article.

 

5. How to collect product brand in Magento

To collect the "Brand" field in the Connectif product sheet in the Magento integration, it is necessary to activate the "Manufacturer" field in Magento and provide the corresponding values so that it arrives automatically.

This field is not active by default in Magento, so to activate it you must follow these steps:

1. Go to "Stores > Attributes > Attribute Set".

Integración con Magento campo manufacturer - 1-min.png

 

2. Locate the "Default" attribute group.

Integración con Magento campo manufacturer - 5-min.png

 

3. Double-click to edit it, and once inside, add the "manufacturer" field to the "Product Details" folder by clicking on it and dragging it inside the folder.

Integración con Magento campo manufacturer - 2 (2)-min.png

4. Click Save to confirm this configuration. This way, the data in the "manufacturer" field will always be transmitted for products that have this attribute group.

 

For the brand to be transmitted automatically to Connectif through this process, you must have created it within this field. If you have done it through another field, you must adapt it to this procedure.

Integración con Magento campo manufacturer - 3-min.png

 

5. If you have other product attribute groups in your catalog from which you want to transmit the brand, you must repeat the process.

Integración con Magento campo manufacturer - 4-min.png

 

6. To ensure that the field will be transmitted in the different product groups, you can check any product in your catalog that belongs to one of them and make sure the "manufacturer" field is included in its Magento sheet. Inside it, you can also change it if needed through the dropdown.

Integración con Magento campo manufacturer - 6-min.png

 

6. What should I consider if my Magento 2 store uses Hyvä?

If your store uses Magento 2 with Hyvä, you must check that the template uses Magento's standard JavaScript initialization system *-init to properly launch Connectif scripts.

This configuration is necessary because Hyvä modifies Magento's frontend system and can change how some scripts are initialized. The Connectif module relies on Magento's standard mechanism to execute tracking and contact identification scripts.

To complete the integration, check with your development team that the Connectif scripts are initialized using *-init, using data-mage-init or text/x-magento-init, as appropriate.

Once this configuration is applied, validate that the integration correctly captures the main store events. You can see how to do this in this article.

 

 


Keep Learning!

To take full advantage of your Connectif account’s potential, we recommend continuing with the following articles: