5 Best Ways To Configure Google Analytics in Adobe Magento

Make better data-driven decisions for your Magento eCommerce store by adding Google Analytics. Here’s how to optimize your reporting.

By Beth Shero

Sure, Adobe Commerce stores powered by Magento come with built-in reporting tools, but you can make better data-driven decisions for your store by adding Google Analytics.

If you don’t know, Google Analytics’ reporting features include eCommerce tracking, conversion and goal-related tracking, demographics, visitor segmentation, and funnel visualization. 

Each of them can help a business truly understand its performance and position in the market.

Ensuring that Google Analytics is set up correctly on your website can appear daunting at first, as there are many ways you can connect to the platform.

But you can choose to either track basic eCommerce statistics, which are available out-of-the-box, or to enable enhanced eCommerce tracking. The second option typically requires some custom development to the Data Layer, or the use of an extension.

We’ve outlined these two different approaches below, plus we’ve added some tips to help ensure that your Magento store with Google Analytics is working to the best of its ability.

  1. Google Analytics Prerequisites
  2. Configuring Google Analytics General eCommerce Tracking in Magento 2 (Built-In, Simpler Method)
  3. Configuring Google Analytics Enhanced eCommerce Tracking in Magento 2
  4. Verifying Your Analytics Connection
  5. (GTM Only) – Using Google Tag Manager’s “Preview” Mode

By the way, if you’re looking to track specific marketing campaigns, our friends at Orbit Media created this handy Campaign URL Builder which allows you to easily track campaigns in Google Analytics.

1. Google Analytics Prerequisites

Universal Google Analytics Property

First, make sure you have a Universal Google Analytics Property set up properly in your Google Analytics account. 

  • Go to your Google Analytics ACCOUNT and PROPERTY columns, and select the property you’re working with. If you don’t yet have a property created for your Magento 2 website, here’s how to create a Universal Analytics Property.
  • Take note of your Property’s UA ID. In the Google Analytics Admin section, click “Property Settings” for the UA property that you’ve created. Take note of your property’s UA Tracking ID (It will be Similar to UA-XXXXXXXXXX-X)
tracking ID
How to find your Google Analytics tracking ID

Google Analytics Property Settings

Ensure that your Google Analytics Property Settings are properly set up. In the Google Analytics Admin section, click “Property Settings” for the UA property that you’ve created, and review these settings in detail. 

Two specific settings are discussed below, but it is a good idea to thoroughly review every option in the admin section for your property.

  • Industry Category
    • Pick the most accurate industry for your Magento 2 store. This will help Google provide context into your store’s performance against similar stores within your industry.
  • Turn on “ Enable Demographics and Interest Reports”

If you need help with your Adobe Commerce powered by Magento store, contact us here.

Google Analytics Property View Settings (eCommerce Settings)

Ensure that the settings for your specific Google Analytics View are properly set up. In the Google Analytics Admin section, click “View Settings” for your primary view in your UA Property. 

The most important settings for Magento 2 stores are inside the view’s “eCommerce Settings” and are discussed below:

  • Turn on “Enable eCommerce”
    General eCommerce tracking helps you see your marketing campaigns, coupons, affiliations, average sales, revenue and general conversions.
  • If desired, turn on “ Enable Enhanced eCommerce Reporting”.
    Enhanced eCommerce Reporting can provide much more in-depth analytics such as shopping/checkout funnels, tracking when users add or remove products from their carts, and much more. However, it also requires additional data to be provided in the Magento store’s data layer, which requires custom development or the use of an extension.
    • If you intend to set up Enhanced eCommerce Reporting, then at this point you should also label your checkout steps. Assuming you will use Magento 2’s default checkout, the steps should be:
      1. Shipping
      2. Payment
      3. Place Order
ecommerce reporting
Google Analytics eCommerce reporting Overview

Still with us? If this is overwhelming, don’t hesitate to contact us with any questions.

2. Configuring Google Analytics General eCommerce Tracking in Magento 2 (Built-In, Simpler Method)

Magento’s built-in configurations allow you to easily connect to Google Analytics for general eCommerce tracking. From here, you can choose to connect directly with Universal Analytics, or through Google Tag Manager

Google Tag Manager is free, and can help you add tags to your site if you have many analytics and tracking tags.

For instance, consider using Google Tag Manager if you use multiple analytics and ad performance tracking tools that require site tags.

Connecting Directly to Universal Analytics

  1. Log in to your Magento 2 Admin
  2. Navigate to Stores->Configuration->Sales->Google API
  3. Inside “Google Analytics”, change:
    • “Enable” to “Yes”
    • “Account Type” to “Universal Analytics”
    • “Account Number” to your property’s UA Tracking ID
      (It will be similar to UA-XXXXXXXXXX-X)
      • “Anonymize IP” and “Enable Content Experiments” are disabled by default and generally aren’t needed. You may want to refer to Magento’s documentation to consider enabling these options.
    • Click “Save Config”
  4. To ensure your changes display on the front-end, navigate to System->Tools->Cache Management and refresh your site cache.
universal analytics
How to configure Universal Analytics in Google Analytics

Connecting to Universal Analytics via Google Tag Manager (GTM)

This section assumes that you already have a GTM container with a Universal Analytics tracking tag/variable. This is a quick process, and you can refer back to Google’s official documentation to connect your GTM with your Universal Analytics property.

  1. Log in to your Magento 2 Admin
  2. Navigate to Stores->Configuration->Sales->Google API
  3. Inside “Google Analytics”, change:
    • “Enable” to “Yes”
    • “Account Type” to “Google Tag Manager”
    • “Container ID” to your specific GTM container ID
      (It will be similar to GTM-XXXXXXX)
    • In most cases, you shouldn’t need to change any other settings.
    • Click “Save Config”
  4. To ensure your changes display on the front-end, navigate to System->Tools->Cache Management and refresh your site cache.
universal analytics gtm
How to configure Universal Analytics in Google Analytics via Google Tag Manager

3. Configuring Google Analytics Enhanced eCommerce Tracking in Magento 2

To ensure your Magento 2 store tracks enhanced eCommerce data, we recommend using Google Tag Manager, along with custom development or an extension. 

In most cases, we use Anowave’s “Magento 2 Google Tag Manager Enhanced eCommerce (UA) Tracking” extension. This extension can connect to your GTM container and automatically generate appropriate tags, triggers, or variables to make sure that enhanced eCommerce data is tracked properly. Plus, it includes many other useful features. 

If you’re unsure about how to install or set up the extension, please feel free to contact our team here for support.

4. Verifying Your Analytics Connection

There are a few options to verify your analytics connection:

Using Your Browser’s Inspector Tools

  1. Load your magento 2 website in a browser.
  2. Inspect the page and search for your Universal Analytics Property ID or your GTM Container ID, depending on which implementation method you used.
  3. If you find a match, then the page is likely working correctly.
  4. This can be further verified by reviewing your Google Analytics dashboard and confirming that user data is populating correctly.

Using Google’s Tag Assistant Browser Extension

  1. Install Google’s Tag Assistant Browser Extension (Chrome Required).
  2. Enable the browser extension.
  3. Load your Magento 2 website in Google Chrome.
  4. Click the Tag Assistant Extension Icon and it will provide a report of the connections on the page.
  5. This can be further verified by reviewing your Google Analytics dashboard and confirming that user data is populating correctly.

5. (GTM Only) – Using Google Tag Manager’s “Preview” Mode

  1. Navigate to your Google Tag Manager container and click “Preview”.
  2. Type your Magento 2 store’s URL into the input field and click “Start”.
  3. Your browser will have two windows open. In one window, you can navigate on your site normally. On the other, the Google Tag Assistant will confirm which tags are firing, allowing you to verify that pageviews and other data are being sent to Google Analytics successfully.

Ready to get started with configuring Google Analytics for your Magento store? The info outlined above can help you maximize your marketing, SEO, and conversions through tracking your customer statistics. 

For additional Magento eCommerce advice, or if you have specific questions, contact our team.

Co-founder & CEO