Use code MAG25 to get $25 off! Limited time offer on Cloudways Magento hosting.
AVAIL NOW

How to Add Google Analytics in Magento 2

For running a successful online store, it is important that you must monitor and track the traffic of your store which can help in increasing its sales. If you are not aware of this monitoring and tracking, then it would be difficult for you to increase the ratio of sales. Also, the holiday season is coming, so the tracking of traffic is crucial.

You can easily track and monitor the traffic and also the conversion rate in just a few clicks. Not only that, you can also determine the performance of your store and engagement on all of your store’s pages which can be helpful in improving your store’s SEO.

Now you are thinking, Is it possible?

Yes! By using Google Analytics which is loaded with many awesome and useful features.

For Magento 1 users, I have already taught you about How to Add Google Analytics in Magento. So, now I am going to teach you how to add Google Analytics in Magento 2.

Sign Up for Google Analytics

Go to Google Analytics and then click on Analytics from the left top corner of the page.

Note: Make sure you are logged in to your Gmail account.

click on google analytics magento 2

Now click on the Sign up button:

signup analytics magento 2

Here, it will ask you to enter your store general details like:

Account Name: Enter the account name for your Google Analytics account.

Website Name: Enter the name of your store.

Website URL: Enter the URL of your store

After adding the details, just click on Get Tracking ID:

account details 1

account details 2

Read the terms and conditions of Google Analytics and then click I Accept:

terms and conditions analytics

Now the new screen will appear where you can see the Tracking ID. Just copy it:

analytics tracking ID magento 2

Configuration of Google Analytics in Magento 2

Go to Stores → Configuration of your store then click on Google API under the SALES:

click Google API analytics Magento 2

Then go to the Google Analytics section, enter the Tracking ID in the Account Number field:

configuration analytics magento 2

 

Now just click on Save Config:

save config analytics magento 2

Now it’s time to check the result, open your store frontend and then go to your Google Analytics. Then click on Overview under Real Time from the left side:

real time overview

And you will see the result:

google analytics configured with Magento 2

Wrapping Up

With the help of this step by step guide, you can add Google Analytics in Magento 2 in order to track and monitor your store’s traffic. Still, have any issues with the implementation, just use the comment box below!

About Author

Syed Muneeb Ul Hasan is an expert in PHP and Magento, he prefers to educate users in implementing and learning Magento. When not working, he loves to watch cricket.