How to Configure Google Analytics in Magento 2

There are many factors involved in the success of each ecommerce store, and one of the biggest factors is traffic. Hence, it is crucial for store owners to monitor and keep a complete track of traffic on their stores.

Google offers a free service that allows you to track and monitor the traffic and conversion rate in a few clicks. The service goes by the name of Google Analytics. By using it, you can also determine the user engagement on every page of your store which will help you in improving the SEO of your store.

Magento is perhaps the best ecommerce platform out there, so today, I’m going to teach you how to add Google Analytics in Magento 2.

If you are using Magento 1.x, then you can check this article: How to add Google Analytics in Magento.

Add Google Analytics in Magento 2

  • Create an Account on Google Analytics
  • Configure Google Analytics in Magento 2
  • Enable Ecommerce Tracking

Create an Account on Google Analytics

First, login to your Gmail account and search for Google Analytics. Now click on Analytics from the top corner of the page.

GoogleAnalytics1

Just click on Sign Up.

GoogleAnalytics2

Now enter the details of your store (Account Name, Website Name, and Website URL) and click on Get Tracking ID.

GoogleAnalytics3

Now read the Google Analytics Terms of Service Agreement and then just click on I Accept.

GoogleAnalytics4

Now you will be redirected to the Tracking ID page. Copy the Tracking ID which you have to use in the configuration step.

GoogleAnalytics5

Configure Google Analytics in Magento 2

Log in to the Admin panel of your store and go to Stores → Configuration.

GoogleAnalytics6

Scroll down the configuration page and click on Google API under the SALES tab.

GoogleAnalytics7

Unfold the Google Analytics section, and select Yes from the Enable drop down menu, enter the Tracking ID (which you copied in the first step) in Account Number text field and select Yes from the Enable Content Experiments drop down menu. Now just click on Save Config.

GoogleAnalytics8

Enable Ecommerce Tracking

To enable ecommerce tracking, click on Ecommecre Settings from the Admin area of Google Analytics.

GoogleAnalytics9

Enable Ecommerce and Enhanced Ecommerce Reporting and click on Submit.

GoogleAnalytics10

And you’re all done! Visit your store and then go to your Google Analytics. You will be able to see the traffic activity on your Magento 2 store:

GoogleAnalytics11

Final Words

After following this tutorial, you should now be able to add Google Analytics in Magento 2 to monitor your store’s traffic. You can also check out the Google Analytics Extension by Mageplaza if you want more options. If you have any problem or would like to add to the discussion, feel free to use the comment box below!

Author Bio

Syed Muneeb Ul Hasan is a Magento Developer and Blogger at Magenticians - a platform for Magento Tutorials. He is an expert in PHP and Magento and prefers to educate users in the implementation of Magento. When not working, he loves to play games and watch cricket. You can follow him on Twitter.

how-to
configure
google-analytics
magento-2

Comments for How to Configure Google Analytics in Magento 2

Please leave comments if you have any questions, feedbacks.