Steps to Integrate Google Analytics and Magento: A Comprehensive Guide

By: Published: September 15, 2020


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.

Table of Contents

Hevo, A Simpler Alternative to Integrate your Data for Analysis

Hevo offers a faster way to move data from databases or SaaS applications into your data warehouse to be visualized in a BI tool. Hevo is fully automated and hence does not require you to code.


Check out some of the cool features of Hevo:

  • Completely Automated: The Hevo platform can be set up in just a few minutes and requires minimal maintenance.
  • Real-time Data Transfer: Hevo provides real-time data migration, so you can have analysis-ready data always.
  • 100% Complete & Accurate Data Transfer: Hevo’s robust infrastructure ensures reliable data transfer with zero data loss.
  • Scalable Infrastructure: Hevo has in-built integrations for 100+ sources including 30+ Free Sources like Google Analytics that can help you scale your data infrastructure as required.
  • 24/7 Live Support: The Hevo team is available round the clock to extend exceptional support to you through chat, email, and support calls.
  • Schema Management: Hevo takes away the tedious task of schema management & automatically detects the schema of incoming data and maps it to the destination schema.
  • Live Monitoring: Hevo allows you to monitor the data flow so you can check where your data is at a particular point in time.

Simplify your Data Analysis with Hevo today! 


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. 

Google Analytics and Magento: Create account
Image Source: Self

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

Google Analytics and Magento: Select Web
Image Source: Self

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

Google Analytics and Magento: Property setup
Image Source: Self

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

Google Analytics and Magento: Select country/region
Image Source: Self

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

Google Analytics and Magento: Accept Conditions
Image Source: Self

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. 

Google Analytics and Magento: Tracking code
Image Source: Self

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

Google Analytics and Magento: Configuration > Google API
Image Source: Self

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.
Google Analytics and Magento: Google Analytics
Image Source: Self

Step 4: Set Enhanced E-Commerce Setting

You can set up enhanced ecommerce settings and enable it.  

Google Analytics and Magento: E-commerce setup
Image Source: Self

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:

Google Analytics and Magento: Real-Time > Overview
Image Source: Self


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