Magento is an open-source ECommerce platform that provides merchants with a flexible online shopping system to list products and customize their online ECommerce store. Google Analytics is a tool for your Online Store Analytics including many metrics like traffic, conversions, call to action, bounce rate, etc to help you get a better ROI for the brand.  

Therefore, Google Analytics and Magento must be integrated if you want to make Data-Driven Marketing Decisions with respect to your Online Store. This article will take you through the steps to integrate Google Analytics and Magento.

What is Magento?

Magento is an open-source e-commerce platform that allows merchants with a flexible online shopping system, listing products and customization functionalities of their online eCommerce store. Magento also includes robust marketing, catalog-management, and discount tools. It comes in two editions:- 

  • Magento Community Edition
  • Magento Enterprise Edition

Magento empowers thousands of retailers and brands with the best eCommerce platform and flexible cloud solutions to rapidly innovate and grow. It offers marketing, search engine optimization, and catalog-management tools. 

What is Google Analytics?

Google Analytics is a tool to measure website analytics including many metrics like traffic, conversions, call to action, bounce rate, session duration, pages per session & provides valuable insights to run marketing campaigns to get a better ROI for the brand.  

Therefore, Google Analytics is a must-have tool to be integrated with the website to have key information about your website. You can effectively devise intelligent marketing campaigns on the basis of data provided by Google Analytics. 

Prerequisites for Integrating Google Analytics and Magento 2.x

  1. Google Analytics Account
  2. Magento 2.x Website Backend Access

Steps to Integrate Google Analytics and Magento 2.x

Let’s discuss these points one by one. 

Step 1: Create a New Google Analytics Account 

In case you already don’t have the Google Analytics Account, this is the very first thing you need to create. In order to create a GA account, you need a valid Gmail account. Go to the GA signup page & follow the steps as mentioned on each page. 

You must mention your account name. It could be any name. 

Select the option of platforms you want to track data on. It is “Web”, generally. 

The third step is the Property Setup. You need to mention the name of the website & its URL. 

Next, you have to select the name of the country you are in. GA has different SOPs & Conditions for different countries. 

Finally, click “Accept”. This will complete the creation of your Google Analytics account.  

Step 2: Tracking Code

To be able to collect statistics, you will need to add a Google Analytics code to Magento 2. To find the code, navigate to the left side of your Analytics dashboard, there you will see the Admin Tab. Click on it and choose Tracking Info. There you need to open the Tracking Code. 

You will be needing both i.e. Tracking ID & Tracking Code. 

Step 3: Add Google Analytics API to Magento 2.x

Moving forward to the next step. Now go to your website and log in to the Admin Panel. Choose Stores from the left-side menu. In block Setting, you need to find Configuration

Expand the Google Analytics section and do the following:

  • Set Enable to Yes.
  • Enter your Google Analytics Account Number.
  • If you want to conduct A/B testing and other performance tests on your content, set Content Experiments to Yes.

Step 4: Set Enhanced E-Commerce Setting

You can set up enhanced ecommerce settings and enable it.  

Step 5: Validation of GA 

Finally, you need just to check if everything is set up fine. Just open your website frontend and Magento Google Analytics account in the second tab. Choose Real-Time report, click Overview. There should be 1 active user on site right now:


By following the above-mentioned steps, it is quite simple to integrate Google Analytics and Magento Store. There are many functionalities that need to be configured for multiple purposes.


Hevo Data is a tool that provides all the functionalities & development of data flow pipelines in just a few clicks. Hevo has integrations with 100+ sources including 30+ Free sources like Google Analytics, etc.

SIGN UP and experience the feature-rich Hevo suite first hand.

Share your thoughts on integrating Google Analytics and Magento in the comments below!

Muhammad Faraz
Freelance Technical Content Writer, Hevo Data

In his role as a freelance writer, Muhammad loves to use his analytical mindset and a problem-solving ability to help businesses solve problems by offering extensively researched content.

No-code Data Pipeline For Your Data Warehouse