Add Google Analytics Code In Magento 2

Google Analytics is a free Web analytics service that provides statistics and basic analytical tools for search engine optimization (SEO) and marketing purposes. This service helps store owners to boost sales, find more customers, improve their business.

Here are some benefits of using Google Analytics with eCommerce store.

  • Able to find out how your visitors locate your website.
  • Identify which pages and links your visitors click the most.
  • Visitor segmentation.
  • It’s completely free
  • Product Performance
  • Sales Performance
  • Conversion rate

and many more!!

A large number of Magento 2 store owners do not utilize all the wonderful eCommerce features that come built-in with Google Analytics. These features include eCommerce tracking, conversion and goal related tracking, demographics, visitor segmentation. All of them can help a store owners to truly understand their market.

Track your visitors and your sales with Magento 2 and Google Analytics

In order to setup your Google Analytics account with Magento 2, First you need to sign up at You will receive a Google Analytics account number. Although Google Analytics will show embed javascript code to integrate with your website, but you don’t have to do that. You just require GA Tracking code(e.g. UA-XXXXX-X) to setup with Magento 2.

Log into your Magento 2 Admin Area and navigate to Stores -> Settings -> Configuration -> Sales -> Google API -> Google Analytics. Pick the Yes option from the Enable drop-down menu. Enter the Google Analytics account number in the Account number field and click on the Save Config button.

Perfect. The Google Analytics code is added to your Magento 2 store.

1 Comment

  1. Excellent article!! Thank you for the information. I appreciate it.

Leave a Reply

Your email address will not be published.