The Importance of Google Analytics 4 for Magento 2: All You Must Know

In October 2020, the eCommerce world was taken aback when Google announced they would retire the Universal Analytics solution on July 1, 2023.

Thus, stores that kept track of their customers and traffic using Universal Analytics will now have to move to Google Analytics 4.

So in this article, we will introduce to you what exactly is Google Analytics 4 and the importance of Google Analytics 4 for Magento 2. Let’s get started!

open shopify store

What Is Google Analytics 4?


Google Analytics is one of the most widely used tracking tools on the market. It allows you to collect data that will help you make relevant decisions to grow your business.

A basic application of Google Analytics is to track key metrics about website traffic and visitors, such as Page View, Bounce Rates, Traffic Sources, Session Times, etc. There is also real-time tracking of how many visitors are on the website at a given time, where they are from, and what they are browsing.

Google Analytics 4 is the latest and the most advanced version of the free website analytics tool by Google.

Compared to Universal Analytics, the new version have some changes as below:

  • Unlock more important eCommerce metrics (Conversion Rate, Product List Views, Checkout Step Drop-off, Per-Product Performance, Measurement of Cart Events, etc.)
  • Better supports tracking multi-channel (web & app, cross-device, cross-platform)
  • Focus on Event instead of Session (user-focused)
  • Doesn’t depend on cookies to identify users
  • Better integration with Google Ads
  • Offer Machine Learning

>>> Let’s take a look with useful article: How To Migrate Universal Analytics To GA4

The Importance of Google Analytics 4 for Magento 2


In the business world, data is currency. Especially considering the fact that nowadays there are more and more competitions in the online environment. Hence, it’s crucial to gather relevant data about your visitors.

And Google Analytics is the perfect tool to help online store owners peek into the customer’s journey and collect actionable data.

Below are some major benefits of the Magento 2 Google Analytics 4 integration:

  • Detailed data reporting and analysis
  • Enhanced tracking of customer’s journey
  • Better analysis of visitor engagement
  • Unified web and app analytics
  • Custom event creation and tracking

How To Set Up Google Analytics 4?

This part is a comprehensive tutorial on how to set up Magento 2 GA4.

Create a Google Analytics property

The first thing you need to do is create a new Google Analytics 4 property.

Log in to your GA dashboard with your Gmail account and click the settings cog to open up the Account Settings.

In the Property section, click Create Property. Then input your Property Name, Reporting Time Zone, and Currency, then click Next.

You can share some data about your business with Google so they can tailor your experience. However, this part is optional, so you can choose not to share.

Finally, click the Create button.

Set up a data stream and get the measurement ID

After creating the property, you need to add Global Site Tag to your store.

Next, set up a Data Stream (which represents which data is collected).

Because you are setting up Google Analytics for your online store, select Web in the Choose a Platform section.

A window will be displayed in which you will set up your data stream and get your Measurement ID.

Input your Website URL and Stream name.

Then in the Enhanced Measurement section, there will be some default tracking and insights. You can click the settings cog to read more about the events captured and disable some insights you don’t need.

Click the Create button, and the Web Stream Details window will be displayed. Here you will see your Measurement ID and the tagging instructions to add the Tracking ID to your Magento store.

In the Tagging Instructions tab, expand the Install manually section and copy the Global Site Tag script there.

Set up the Global Site Tag in Magento 2

Now you have your GA4 Global Site Tag, head into your Magento Admin section to add it to your website.

Note: This doesn’t require any coding knowledge, so you don’t need a web developer for it.

First, log in to your Magento Admin and navigate to Content > Design > Configuration.

Choose the Store View you want to add GA Global Site Tag to and click the Edit button.

Expand the HTML Head section and paste the GA Code you copied into the Scripts and Stylesheets section.

Click the Save Configuration button.

Then in the Magento Admin, navigate to System > Tools > Cache Management.

Click the Flush Magento Cache button and reload your Magento 2 store frontend.

And that’s done. Your Magento website should be tagged with the GA4 tracking code.

Verify your Magento 2 store is tagged with GA4 code

There are several ways to check if your store is tagged. In this post, we will show you the two simplest methods.

Verify by inspecting the source code

This is the quickest way to check if your store is properly tagged with Google Analytics code.

On the front end of your website, right-click and click View Page Source.


Inside the tag, you should see the Tracking ID (Global Site Tag) you inserted in the last step.


If you don’t see it, maybe because your store’s cache hasn’t been cleared successfully or you are using a CDN. You should purge your cache. 

Verify by using the Tag Assistant extension

Another method to confirm the GA4 Tag is present is to use the Tag Assistant browser extension.

Note: This extension is made by Google, so it’s 100% safe.

To start, if you don’t already have the extension, you must install it from the extension store. After having it installed, in your browser extension list, click the extension and click Enable.


Then reload the page, click the extension again, and you should see the Global site tag in the Result of Tag Analysis section.


The great thing about the Tag Assistant extension is that you can check a lot of neat information about your Google Tag, such as Container ID, Account ID, etc.

Verify real-time data in Google Analytics 4

After confirming that your GA4 tag is present on your website, next, you should check if the real-time data makes it into your Google Analytics 4 property so you can collect customer behavior data.

Log into your Google Analytics account again and select the GA property you just created in the first step.


On the left-hand menu, navigate to Home. Note that you might not see much data here yet, because it can take 24-48 hours for it to start reporting data.

Next, you can navigate to Realtime to see current visitors on your website in real-time, including yourself.


Enhanced Ecommerce Implementation For Magento 2

The guide above has shown you how to implement a simple GA4 tracking integration for your store, which helps you measure:

  • Page views
  • Scrolls
  • Site search
  • Outbound clicks

These are all great metrics to track. However, as an eCommerce store owner, you will require more specific and specialized information about your users and products to build business strategies.


Google Analytics 4 provides Enhanced eCommerce category to have you track important eCommerce metrics like:

  • Conversion rate
  • Revenue and Per-product performance
  • Product detail metrics
  • Checkout steps
  • Checkout step drop-off
  • Product impressions 
  • Product clicks
  • Cart actions
  • Coupon code usage
  • Promotional material impressions and clicks

>>> Must know: Top 5 Best Magento 2 Google Analytics 4 Extensions To Track Data

The Best Magento Website Development Service

As you can see, Google Analytics 4 is indispensable for any eCommerce store. It helps you track important business data to grow your business.

So whether you are using the Universal Analytics version or haven’t used Google Analytics at all, we highly recommend you to set up GA4 for your website right now.

And in case you can’t do it yourself, allow us to introduce you to the best service to help you do it:

BSS Commerce’s Magento Website Development Service


This service is fully customized to every aspect of Magento Website Development for small to large businesses.

Other than migrating Universal Analytics goals and conversions to Google Analytics 4 and implementing Google Analytics 4 for your website, this service also offers you many amazing solutions.

Magento Website Development Service by BSS Commerce can help you:

  • Consulting: Their Magento solution specialists will come up with optimal solutions based on the best business insight to help you in every aspect of the website development.
  • Integration: With third-party integrations (payment gateway systems, inventory management software, ERP systems, or CRM systems, etc.), they strive to bring a seamless and unified Magento experience.
  • Deployment: They help set up the deployment process for a highly customized website to help stores reach maximum performance.
  • Maintenance & Optimization: They will accompany you after launching your website to help avoid issues and security vulnerabilities.
  • Migration: If you already have a website using another platform, they can help you with the Magento migration and give you the feature-rich and customizable website.
  • Build a website from scratch: They will accompany you from the very first step to launch a Magento website and whenever you need help.


In this article, we have introduced to you what Google Analytics 4 is, why it is so important and how to integrate it into your Magento 2 store.

We hope this blog is helpful and good luck to you!

Write A Comment