General

Set up Google Analytics eCommerce tracking in Magento 2

Hello E-commerce Folks?,

How are you all performing? In today’s article, I am going to explain How to Set up Google Analytics eCommerce tracking in Magento 2. In the last article I have discussed Two Factor Authentication for Magento 2 -Everything You Need to Know. Let’s begin with setting up Google Analytics eCommerce tracking?

Preface:

Do you have a website? Do you have an E-commerce website? Google offers a tracking service for monitoring all the traffic on your website. It has enhanced features of tracking the conversion ratio and measures your website’s traffic. Google Analytics is a very helpful tool for all websites, especially E-commerce websites. It helps in the E-commerce merchants to supervise their Magento stores. Magento provides a built-in Google Analytics tracking option that helps the Magento merchants to emphasize their websites in terms of optimizing in targeted fields. As we all know that in these trending technologies everything is trackable.

Basically, many of the E-commerce store owners are unaware of the feasible features of the Google Analytics tracking service. Including the website, traffic insights google analytics provides featured views of visualizations & demographics, goal setup and tracking, visitors segmentation. This all advanced features helps in monitoring your Magento E-commerce tracking.

I have got many queries in my inbox from the Magento Merchants related to issues in fixing Google Analytics in their Magento E-commerce website. Many times configuring the Google Analytics in your Magento websites might be a complex task for you especially when some issues are encountered.

Steps to Set up Google Analytics eCommerce tracking in Magento 2:

Step 1: Get Google Analytics Tracking ID

Note: In case if you don’t have a Google Analytics account create a new one free from here.

-For getting the Google Analytics Tracking ID you will have to login in your google analytics account and navigate to Admin settings right from the bottom of the left bar in your google analytics account

– After that tap on Create Account

– Fill out the appropriate details given below.

Read carefully the terms and conditions and accept them. After that, you will get the tracking code.

Step 2: Configure Google Analytics in Magento 2:

– Navigate to Stores>Configuration>Google API

– Now, after this enable the Google API field and paste the Google Analytics code in the Account Number section and click on Save Config for implementing the changes.

Step 3: Set up Magento Ecommerce Tracking

  • Google Analytics provides advanced tracking reports for E-commerce websites. All the activities are monitored with this feature including the purchase activities, transaction details, conversion rates, and much more in your Magento 2 store. For settings that navigates to the Admin section of your google analytics account and clicks on E-commerce settings.

  • After this just turn on the E-commerce and enhanced E-commerce reporting option and tap to Save Button.

  • Now just check that you have successfully set up the Magento 2 Google Analytics perfectly. Get started with your Magento 2 store and wait for some time to reflect traffic data in your Google Analytics property.

That’s It. As you can review the above Screenshot you have successfully configured Magento 2 Google Analytics for your E-commerce store.

If you wish to implement Universal Analytics Enhanced Ecommerce for deep insights of product views and sales promotions tracking then check our addon guideline below,

Universal Analytics Enhanced Ecommerce:

Mainly, with the help of Google Analytics Enhanced Ecommerce, you can send your promotion, sales and product impression details via Google Analytics pageviews and events. With the help of page views, you can track the promotion, sales and product impression. And also the checkout steps and product clicks via events.

Enabling Enhanced Ecommerce

Mostly, when you apply this you need to make sure to enable the Enhanced Ecommerce on each and every event tag of the Universal Analytics pageview. It consists of mainly 2 methods 

Implement with the help of Data Layer (Recommended by Google)

Using the Data Layer

Check the below-given sections for measuring the enhanced ecommerce activities with the help of Data Layer:

Implement with the help of Custom JavaScript Macro

Check the below-given sections for measuring the enhanced ecommerce activities with the help of Custom JavaScript Macro

Over to You.

Therefore, implement the above steps to configure Google Analytics in your Magento 2 store. In case you face any issues then make sure you upgrade your Magento 2 store and then try it. And still facing problems then describe it in the comment box. I will solve it there. If you are kind of a non-developer then no worries use Magento Upgrade Service for upgrading your Magento 2 store. Help your friends in fixing Google Analytics in their Magento 2 store by sharing this article with them. Till then Stay Happy and Stay Safe.

Happy Tracking?

Click to rate this post!
[Total: 10 Average: 4.8]
Gaurav Jain

Gaurav Jain is Co-Founder and Adobe Certified Expert-Magento Commerce Business Practitioner. Being Computer Engineer?‍? and possessing Extensive Marketing skills he handles all kinds of customer Queries and his Happy? & Helping? Nature makes customer's day Delightful. When he isn’t working, you’ll find Gaurav Reading on Books? or Traveling?. Also, he is Speaker at Magento Meetups.

View Comments

  • Hey, nice article! I have a question. We implemented everything as above. Normal analytics are taken, but no ecommerce. I read, that only the payed version of Magento 2 allows ecommerce-tracking. Is that correct?

Recent Posts

Generating Thumbnails with Spatie Media Library in Laravel 11: A Step-by-Step Guide

Generating image thumbnails is a common requirement in web applications, especially when handling media-heavy content.…

24 hours ago

Enhancing Web Application Security with Laravel’s Built-In Features

In today’s digital landscape, web application security is paramount. As a powerful PHP framework, Laravel…

2 days ago

Magento 2 Extensions Digest October 2024 (New Release & Updates)

October was an exciting month for MageComp! From significant updates across our Magento 2 extension…

2 days ago

Improving Error Handling and Transition Management in Remix with useRouteError and useViewTransitionState

In modern web development, seamless navigation and state management are crucial for delivering a smooth…

1 week ago

Magento Open Source 2.4.8-Beta Release Notes

Magento Open Source 2.4.8 beta version released on October  8, 2024. The latest release of…

2 weeks ago

How to Create Catalog Price Rule in Magento 2 Programmatically?

Hello Magento Friends, Creating catalog price rules programmatically in Magento 2 can be a valuable…

2 weeks ago