Skip to main content
Integration Guide: Magento 2

Learn more about Listrak's Integration with Magento 2 and the steps to integrate.

Updated over 2 years ago

Integrating your Magento store with Listrak is an easy way to increase the overall effectiveness of your email marketing strategy. The integration enables you to launch a shopping cart abandonment campaign, structure post-purchase message threads, and target specific customers through purchase history profile attributes.

The Listrak integration and your Magento store authenticate use OAuth1 and TLS1.2 or higher to encrypt data transmissions. The integration only transmits data points required by Listrak solutions.

⚠️ We strongly recommend that you do the following:

  1. First install this extension on a development environment to ensure proper functionality of the code prior to deploying to your production environment. Open source software can create scenarios of infinite configuration options that may negatively impact the Listrak extension.

  2. Confirm that your store meets the minimum requirements for a Magento 2 store.


Installing the Listrak Extension with Magento Composer

The Listrak Extension can be installed using Composer from a repository on the Listrak Servers. To install the extension, simply add the following lines of code into your store’s command line.

  1. Open the Magento command line.

  2. Enter the following commands into the command line at the root of your website:

composer config repositories.listrak composer https://s1.listrakbi.com/Magento2/Composer
composer require listrak/listrak-remarketing
bin/magento setup:upgrade
bin/magento cache:clean


Activate the Extension

After you’ve confirmed that your extension is installed, we need to activate it to enable your storefront to communicate directly with the Listrak platform.

  1. Click System on the left-hand navigation panel.

  2. Then click Integrations.

  3. Locate the Listrak Integration in the list of your current integrations.

  4. Click Activate.

    A pop-up dialog box appears that asks you to enable the integration.

    ⚠️ Enable pop ups on your browser before continuing. To learn about how to do so, click here.

  5. Click Allow.

    Why does Listrak need access to my API?

    Allowing Listrak access to your API enables Listrak to retrieve order, customer, and product information from your storefront so you can send more targeted sends based on customer activity. Additionally, the API access is required to run programs like Advanced Retail Segmentation, Shopping Cart Abandonment, Post Purchase, and many more automated solutions. Listrak can access the following API Methods:

    /rest/V1/listrakRemarketing/products
    /rest/V1/listrakRemarketing/orders
    /rest/V1/listrakRemarketing/merchantid
    /rest/V1/listrakRemarketing/settings
  6. After clicking Allow you will be prompted to enter your Listrak credentials in the pop-up.

    💡 Check for pop-up enabling if you do not see the prompt to enter your credentials.

  7. Enter your username and password, then click Login.

    💡 You may be asked to authenticate your browser. If so, simply send the authentication code to your email, then enter it and click Submit Authorization Code.

  8. After you log in, select the one merchant you would like to integrate with. Use the drop-down menu next to the desired merchant to select Main Website > Main Website Store > Default Store View.

    💡 If you have multiple merchants, ensure you are selecting the appropriate merchant to integrate your store with. If you are unsure which one to use, please reach out to your project or account manager.

  9. Click Save Changes.

    A confirmation appears notifying you that the integration activation has been successfully completed.

  10. Click Return to Magento.

    A pop-up warning regarding cache management will appear. The next section addresses this.

  11. Click X to close the dialog box.

Clear Cache

To complete your activation, simply clear your Magento cache.

  1. Click System on the left-hand navigation panel.

  2. Then click Cache Management.

  3. Using the drop-down menu, click Select All.

  4. Then click Submit.

  5. A confirmation appears notifying you that the cache has been refreshed. You are now ready to configure your extension.


Configure the Extension

Storefront Settings

  1. Click Stores on the left-hand navigation panel.

  2. Then click Configuration.

  3. Ensure that you are in the correct store. In this example, we synced our integration with Main Website > Main Website Store > Default Store View. Click on your Store View.

  4. A pop-up appears asking if you are sure that you’d like to switch stores; Click OK.

  5. Click to expand the Sales section.

  6. Then click Listrak Integration. You will see a screen that looks similar to the below image. This is a sample only.

Track with Listrak

  1. Set Track with Listrak to Yes.

💡 This will enable or disable the JavaScript tracking on your website. If you disable this, you will no longer track conversion information in Listrak. If you have questions regarding this, please contact your Project or Account Manager.

MERCHANT ID

  1. Your unique Merchant ID will auto-populate.

💡 The merchant ID is unique to you and your store. If you have multiple stores, each of them will correspond to a different merchant ID so there is no cross contamination of data.

 

Email Capture Fields

Email capture fields are used to capture email addresses of customers as they are entered into various capture points on your website. For example, if you have an email text box on your checkout page, adding an email capture point for your checkout page will allow us to capture the email address and re-target them through Listrak.

By default, Listrak Adds:

  • Newsletter

  • Email

  • Customer-email

Follow the instructions below for adding additional capture fields and ensuring that each capture point is accounted for.

For each email capture point on your website:

  1. Navigate to a page on your website where the email address field exists.

  2. Right click on the text field itself.

  3. Click Inspect Element.

  4. If the input tag has an ID, copy the value.

  5. If the input tag does not have an ID, copy the value of the name. E.g. newsletter

  6. In your configuration, ensure your capture point ID is already there. If it is not, click Add Field.

  7. Add the value that you copied from the input into the new field.

  8. Repeat Steps 1 through 7 for each capture point on your website.

  9. Click Save Config.


Change the Session Timeout

We recommend you change your session time to seven days. Magento allows you to define how long cookies will exist on a customer’s computer before expiring. The default setting is 3600 seconds, or one day. 

To update this to the recommended settings for your Automated Marketing Campaigns, such as Shopping Cart Abandonment, complete the following steps to increase the timeout from one day to seven days.

  1. Click Stores on the left-hand navigation panel.

  2. Then click Configuration.

    💡 Check the drop-down menu to ensure you are still on the store configuration as you were when setting up the initial configurations. 

  3. Ensure you are on the General tab.

  4. Click Web.

  5. Click Default Cookie Settings.

  6. Next to Cookie Lifetime uncheck Use Website.

  7. Change 3600 to 604800.

  8. Click Save Config.

Congratulations! Your Magento Storefront has been configured with the Listrak Magento Module. Please indicate this has been completed based on the above instructions to your project manager so they can re-confirm for you.


Upgrading Your Magento Extension

Checking for Updates

To check whether an upgrade has been pushed out for the extension, simply add the following lines of code into your store’s command line. 

  1. Open the Magento command line.

  2. Enter the following commands into the command line at the root of your website:

composer show listrak/listrak-remarketing --latest

If an update is available, you will see the following as a result:

Upgrading the Extension

To upgrade the extension, simply add the following lines of code into your store’s command line.

  1. Open the Magento command line.

  2. Enter the following commands into the command line at the root of your website:

composer require listrak/listrak-remarketing:^6.0.1
bin/magento setup:upgrade
bin/magento cache:clean

After you have completed your upgrade, you will see the following results:


Uninstalling the Extension

To uninstall the extension, simply add the following lines of code into your store’s command line, and follow the prompts.

  1. Open the Magento command line.

  2. Enter the following commands into the command line at the root of your website:

    bin/magento module:uninstall Listrak_Remarketing

    In some versions of the software, the uninstall process halts on removing the extension’s code:

    If the process is not working for more than a minute, hit Ctrl+C then run the following commands to complete the process.

  3. Open the Magento command line.

  4. Enter the following commands into the command line at the root of your website:

    composer remove listrak/listrak-remarketing
    bin/magento cache:clean
    bin/magento maintenance:disable

Did this answer your question?