How to Setup Magento 2 Google Analytics 4 Extension

Meetanshi
4 min readNov 28, 2023

--

E-commerce businesses heavily rely on data-driven insights to make informed decisions.

Integrating Google Analytics 4 into Magento 2 becomes crucial for understanding customer behavior and optimizing online store performance, especially after the sunset of Universal Analytics.

Google Analytics 4 serve as the backbone for assessing customer interactions, product performance, and effective marketing strategies.

Today, we’ll explore how to set up Meetanshi’s Magento 2 Google Analytics 4 Extension in an easy, step-by-step manner. We’ll walk through each step using straightforward language to make the process crystal clear.

Set Up Meetanshi’s Magento 2 Google Analytics 4 Extension

Setting up Google Analytics 4 (GA4) on your Magento 2 store is crucial for comprehensive e-commerce tracking.

Meetanshi’s Magento 2 Google Analytics 4 extension simplifies this process, allowing seamless integration and accurate data collection.

Here’s a detailed step-by-step guide to configure GA4 using Meetanshi’s extension.

Step 1: Install & Enable the Extension

Begin by downloading and installing Meetanshi’s Magento 2 Google Analytics 4 extension. Once installed, navigate to Stores → Configuration → Meetanshi → GA4 to enable the extension within your Magento backend.

Step 2: Add GTM Code to Magento 2

Step -2 Add GTM Code to Magento 2 while setting up Magento 2 GA4 extension
  1. Access your Google Tag Manager (GTM) account and go to Account → Container.
  2. In GTM, locate the JS and non-JS codes under Admin → Install Google Tag Manager.
  3. Copy these codes and paste them into the corresponding fields in Stores → Configuration → Meetanshi → GA4 configuration within your Magento admin panel.
  4. Save the configuration settings to proceed.

Step 3: Configure the Extension

Customize the extension settings for optimal GA4 integration:

Configure the Magento 2 GA$ Extension in Magento 2 admin
  1. Set the Product Identifier, enabling product brand and variant tracking.
  2. Define the order success page total calculation method.
  3. Configure exclusions for tax, shipping, and zero-value orders.
  4. Specify success page paths for custom checkout pages.
  5. Enable product click measurement and choose between child vs. parent product tracking.

Step 4: Magento 2 GTM API Configuration

Magento 2 GTM API Configuration in Magento 2 Admin panel
  1. Obtain your Google Tag Manager Account ID and Container ID from your GTM account settings.
  2. Navigate to Stores → Configuration → Meetanshi → GA4 in your Magento admin panel, and input the Account ID and Container ID in the provided fields.
  3. Enter the Measurement ID from your GA4 account into the extension settings.

Step 5: Generate & Import JSON into GTM

  1. Copy the GTM Public ID from your GTM account settings.
  2. Paste the GTM Public ID into the extension’s respective field.
  3. Save the configuration to progress to the next step.
  4. Click ‘Generate JSON for GTM — Tags, Triggers, and Variables’ within the extension.
  5. Download the generated JSON file.
  6. In your GTM account, navigate to Account → Container, access the Admin tab, and select ‘Import Container.’
  7. Choose the downloaded JSON file and import it into GTM.
  8. Preview the imported tags in GTM’s workspace and submit them.

You’ve now successfully set up Google Analytics 4 extension on your Magento 2 store. Your GA4 dashboard will soon start populating with valuable data insights like purchase!

Why Does This Extension using Google Tag Manager (GTM)?

In the bustling world of Magento 2 stores, the role of Google Tag Manager (GTM) often remains a mystery. Meetanshi’s Magento 2 Google Analytics 4 Extension harnesses the power of GTM for a reason — it’s the linchpin that seamlessly weaves together the intricate tapestry of your store’s data.

In reality, GTM acts as the vigilant sentinel, meticulously capturing every interaction, from product views to completed purchases. It’s the facilitator that enables precise tracking, providing a comprehensive view of customer behavior.

Utilizing GTM within this extension isn’t just a technicality; it’s the conduit that transforms raw data into actionable insights.

Why Choose Meetanshi’s Magento 2 Google Analytics 4 Extension?

Here are the reasons of choosing Meetanshi’s Magento 2 Google Analytics 4 extension for you Magento store for accurate tracking and analysis,

  • It Simplifies Integration process of incorporating GA4 into Magento 2 with an easy to configure setup.
  • Setting up this extension enhance the tracking using GTM for comprehensive insights of user behavior.
  • Configurations of this extension are customizable to setting up precise adjustments for tracking each event and aligning it with GA4.
  • Meetanshi ensures reliable support team, provides the support and help throughout the integration process and offering support whenever needed.

Final Words

In summary, with Meetanshi’s extension, delve into an analytics-rich journey.

Effortlessly set up GA4, utilize the power of Google Tag Manager, and unlock a world of personalized configurations.

This extension help you to take informed decisions, customer experiences with your store, and growing up your Magento 2 store with the help of accurate data collected in GA4.

Resource: https://meetanshi.com/blog/setup-magento-2-ga4-google-analytics-4-using-gtm/

--

--