How to Set Up Magento 2 Google Analytics Ecommerce Tracking

Creating Google Analytics Ecommerce Tracking Program in Magento 2

In this article, you will learn how to create and configure Magento 2 Google Analytics Ecommerce Tracking Affiliate Program. Please, check the following step-by-step guide.

Step-by-Step action:

  1. Go to the “Plumrocket” tab in the main menu.
  2. Navigate to the “Affiliate Programs” tab > select “Manage Affiliate Programs“.
2 configuration affiliate extension magento 2 cj v1.jpg

Step-by-Step action:

  1. Press on the “Add New Affiliate” button.
2a configuration affiliate extension magento 2 v1.jpg

Step-by-Step action:

  1. From the list of the affiliate programs select “Google Analytics“.
  2. Press the “Continue” button.
1 configuration affiliate programs magento 2 google analytics v1.jpg

Configuring Google Analytics Ecommerce Tracking Program in Magento 2

After you created a new Google Analytics Ecommerce Tracking Affiliate Program, you need to configure it. Please, follow the steps below.

Step-by-Step action:

  1. Specify the “Name” of your Affiliate Program.
  2. The “Status” option allows you to enable or disable the Affiliate Program.
  3. In the “Store View” section you may select the store view(s) where your Magento 2 Affiliate Program will be executed.
2 configuration affiliate programs magento 2 google analytics v1.jpg

Step-by-Step action:

  1. “Google Analytics API” allows you to configure the Google Analytics Affiliate Program by following the instructions provided by the system. After you enable your Google Analytics – refresh this page.
  2. Once you see the success message, click on the “Save” button.
3 configuration affiliate programs magento 2 google analytics v1.jpg

To enable Ecommerce tracking, you need to sign into your Google Analytics account and follow the steps below.

Step-by-Step action:

  1. In your Google Analytics account press on the “Admin” button.
  2. Select the “View Settings” option.
  3. Change the Ecommerce tracking switcher to “On” in the “Ecommerce Settings” section. When the change has been done, press the “Save” button to save these settings.
Google analytics enable ecommerce.png

Testing Google Analytics Ecommerce Tracking Code in Magento 2

In order to test and check whether your Magento 2 Affiliate Program has been installed properly, please check the instructions below.

Step-by-Step action:

  1. Create a test order at your Magento 2 frontend and proceed to the Order Success page.
  2. Using your browser’s Developer Tool (“F12” key on your keyboard) open search bar (“Ctrl+F” keys on your keyboard) and look for the code which contains var _orderData = {“order_id”:
  3. The part of the code will appear.
5 configuration affiliate programs magento 2 google analytics v1.jpg

If you locate the part of the code by Google Analytics – this means that your Google Analytics Affiliate Program has been set up correctly. Now log into your account at google.com and verify that your transactions are being tracked correctly.

Was this article helpful?