Home » eCommerce » How to Add Google Analytics 4 (GA4) with GTM in Magento 2?

Connecting Google Analytics 4 to Magento 2

How to Add Google Analytics 4 (GA4) with GTM in Magento 2?

Did you know that nearly 3.78 billion people purchase consumer goods via the internet, and 60.1% of the goods are purchased using mobile phones? Thanks to Datareportal, these statistics make so much sense when it comes to understanding consumer behavior by any eCommerce owner. 

Every eCommerce store owner wishes to have a precise and more in-depth knowledge of what their customers want, how they think before making a purchase, and what interests them often. This is where the power of web-analytic tools comes in. Most eCommerce businesses trusted Google’s Universal Analytics to analyze customer actions until the company released its advanced version – Google Analytics 4. Moreover, Google has also announced discontinuing the former version in July 2023, which can be a good chance for all the Magento store owners to try their hands at the GA4 and get acquainted with it.

Why Should You Integrate Your Magento with GA4?

Web analytics is the fuel to any online business as they can help eCommerce store owners make data-driven decisions and mold a better business strategy based on valuable insights. However, more and more customers are resorting to using mobile phones than just using the web, requiring Magento store owners to track customer behavior on multiple channels.

Google Analytics has been helping eCommerce businesses with key analytics metrics like web traffic, sources, visitors, and more. Fortunately, the latest version, GA4, is an advanced version that collects and unifies data from the web as well as mobile application channels to streamline data reporting and analytics. Moreover, it also helps online store owners to refine tracking information about specific events occurring throughout their store. 

Unlike Universal Analytics, GA4 utilizes event-based tracking instead of session-based tracking leading to actionable data for eCommerce businesses. Here are a few benefits of integrating your Magento store with GA4:

  • Detailed Data Reporting & Analysis
  • Enhanced Tracking of Customer’s Journey
  • Better Analysis of Visitor Engagement
  • Easy-to-Setup Goals
  • Unified Web & App Analytics
  • Enhanced Visualization & Tracking
  • Custom Event Creation & Tracking

How To Setup GA4 (Google Analytics 4) with GTM to Magento?

GA4 comes with additional features and so are the complexities of connecting it with your Magento 2. With our Magento 2 GA4 using GTM Support extension, it is possible to set up your store using GTM easily. Here are the steps to add Google Analytics 4 (GA4) with GTM to magento 2.

  • Step 1: Create a Google Tag Manager (GTM) account and container
  • Step 2: Install the Google Tag Manager 2 Extension
  • Step 3: Connect your GTM container with the Magento GTM extension
  • Step 4: Create a GA4 configuration tag in GTM
  • Step 5: Test your connection in GTM Preview Mode

Keep reading further for a learn each steps on how to connect GA4 with GTM to Magento 2 store. 

Step 1: Create a Google Tag Manager (GTM) account and container

Once you land on the official Google Tag Manager page, click on the “Start for free” button. If you are new to this, we recommend you take a quick read at this easy and simple guide by Google on how to create your GTM account

Step 2: Install the Google Tag Manager 2 Extension

The internet is flooded with multiple GTM extensions that can do the job best for your eCommerce business. As long as your Magento 2 GTM extension is configured as per the GA4 enhanced eCommerce documentation, it is good to go. Once you install the GTM extension, connecting it to your GTM account is easy. 

Step 3: Connect your GTM container with the Magento GTM extension

  • Click on the GTM ID number once you pen your GTM container

Connect your GTM container with the Magento GTM extension

  • Copy the GTM ID number from the code

Copy the GTM ID number from the code

  • Follow the path: Stores > Configuration > Sales > Google API > Google Tag Manager section. And open your Magento GTM extension to paste the GTM ID number in the “Container Public ID” section. The GTM gets connected to your Magento webshop once you save the configuration. If you wish to test it, view the page source of your webshop and find the GTM ID number. You can also install the Tag Assistant Legacy browser extension to troubleshoot GTM installations and Google Analytics to get other insights. 

GTM installations and Google Analytics

Step 4: Create a GA4 configuration tag in GTM

  • Create a GA4 property (here is a full list of FAQs for GA4) and open the GTM container. Click on the button “New” in the tags section. 

Create a GA4 property

  • Click on the Tag configuration space to open tag types

Tag configuration space to open tag types

  • Choose the GA4 configuration tag types and enter your GA4 measurement ID number. 

Choose the GA4 configuration tag types

GA 4 measurement ID number

  • Click on the triggering section and choose the trigger “All pages.”

Click on the triggering section and choose the trigger

  • Name your tag “GA4 Configuration” and click save.

Name your tag

  • Once done, you have your Google Analytics property connected to your Magento store with GTM.  

Step 5: Test your connection in GTM Preview Mode

  • Although GA4 takes time to show the traffic, you can click on the “Preview” button in your GTM container (as shown in the first image) and connect after entering your Magento store’s URL (as shown in the second image).

Test your connection in GTM Preview Mode

connect after entering your Magento store’s URL

  • Once GTM opens your webshop in the new tab, open the “DebugView” interface in the Configure section. You can simply see a ‘page_view’ event, which means your GA receives hits and is connected to your webshop.

connected to your webshop

MageDelight’s Magento 2 GA4 extension with GTM:

Now you can keep track of your customer’s shopping journey and their actions using Google Analytics 4 once it is integrated with your Magento store. You can also fetch informative reports on the visitors’ actions, from the overall impressions to their clicks, in just one go with Magento 2 GA4 with GTM Support extension. This extension helps you take a deep dive into the most-sought customer insights to study their expectations and interests to offer an enhanced user experience.

Store owners can measure the accuracy of their web performance using the GA4 account on the basis of the number of visitors, impressions, clicks, session duration, bounce rate, and more! With this key information, it becomes easy to regulate and manage major elements like content and images to gain more traction.

Benefits Of The GA4 With GTM Extension

  • Overcome the hassle of manual integration and save time
  • Easy and simple configuration
  • Full access to the admin to track customer actions
  • Track customer journey on the store site
  • Improve the effectiveness of the store site’s performance
  • Determine the conversion rate
  • Monitor the performance of marketing campaigns
  • Offer better content to targeted customers
  • Create a better shopping experience
  • Leverage both GA and GTM together

You can read this guide for in-depth instruction on How to Setup Magento 2 GA4 (Google Analytics 4) with GTM?

Closing Note:

GA4 is UA’s new and improved version, and shifting your Magento store’s valuable data to GA4 to eliminate the last-minute panic is important.

Also, you can refer this Magento 2 Google Analytics 4 (GA4) With GTM Support Extension’s FAQ Page for most common questions and it’s answers.

If you need assistance integrating GA 4 using our extension, feel free to contact MageDelight.

Tags