How to Add Google Analytics Code in Magento 2 [Updated 2021]

Add Google Analytics Code in Magento 2

Google Analytics is a free web analytics service that facilitates in-depth analysis of your website visitors and provides valuable insights to shape the success strategy of your business.

As nowadays almost every business has their online presence through a website, it’s crucial to deep dive inner structure of the website to confirm it severs its purpose or not. For that, you should analyze your website visitors, the time they stay on your website, pages they visit and many more.

Using Google Analytics, one can understand customer behaviour, most visited, least visited pages, customer location, a customer device, customer retention rate and so many things which we can’t even imagine.

Using all these data, we get to know what type of products and services customers want and plan our product strategy accordingly.

Magento 2 store owners should definitely leverage Google Analytics to get the most out of your product, services, marketing and business.

As an e-commerce store owner, knowing your customers and understanding their purchasing behaviour is very important.

By adding Google Analytics code in Magento 2 store, you can track:

  • How many people do visit the store?
  • How many people visit a particular product page?
  • How many people visit the checkout page and purchase or abandoned the cart
  • From where the traffic is coming from? [Source and Location]

These are the most common things that every Magento 2 store should check after adding Google Analytics Code in Magento 2 website.

Let’s dive and understand step by step process of adding Google Analytics Code in Magento 2.

Step by Step Process of Adding Google Analytics Code in Magento 2:

  1. Create a Google Analytics account
    The first step is to create Google analytics account. If you have already registered earlier, you can skip this step and jump into step 2. If you have a Gmail account, you can just get started by logging in. If you don’t have a Gmail account, you need to create one in order to get started with Google Analytics. After logging in, you will see this screen.Google Analytics Account Setup
  2. Select the category
    Select “web” for the Magento 2 website you are configuring the Google analytics for.Select web
  3. Property setup
    Submit your website name, website URL, industry category and reporting time zone.Property setup
  4. Get your tracking ID
    To analyze the data and collect website visit details, you will need to add Google Analytics code to Magento 2. To get the tracking ID for the Google Analytics integration with Magento 2, move to admin from the Google Analytics dashboard. Under the property, click on property settings > Tracking code. Here you can find the tracking ID. Copy it.Get Tracking ID
  5. Paste Google Analytics Tracking ID in Magento 2
    Log in to your Magento 2 admin panel. Go to Stores > Configuration > Sales >Google API. Expand the Google Analytics tab and Enable it. Add Google Analytics tracking ID under the “Account Number” option.Paste tracking ID in Magento 2 admin
  6. Realtime Tracking
    Once the Google Analytics tracking ID has been added and saved, open your website from browser and Google analytics from a different browser. Move to Reports > Realtime > Overview where it will show active users of your website including you.Realtime tracking

That’s it and you are all set to analyze the data to gather statistics and make data-based business decisions.

Still have questions? Feel free to comment down below. I would love to discuss and solve your problems.

Get Weekly Updates

Never miss Magento tips, tricks, tutorials, and news.

Thank you for subscribing.

Something went wrong.

(based on 11 Reviews)

Marketing Manager at Meetanshi, she is an expert in the field with 6 years of experience. Apart from work, she is a foodie, watch lover and a proud wife.

Leave a reply:

Your email address will not be published.