How to Integrate Google Analytics in Magento2?

Google Analytics is a free Google service which allows the webmasters and web site administrators to monitor their web sites' traffic and conversion ratio.

Configure google analytics in Magento with following steps.

Step 1 : First you need to sign up at You will receive a Google Analytics account number.
Write it down since you will need it for the Account Number in Magento configuration.
Code would be simillar to following one.

<!-- Google Analytics -->
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
<!-- End Google Analytics -->

Step 2 : Now we need to configure this Google Account ID in Magento Account Number.

Step 3 : Go to System -> Configuration -> Sales -> Google API.

Configuration Analytics

Step 4 : Expand Google Analtics.


Step 5 : Enable to Yes and enter Account Number and Save.

Step 6 : Finish.

Feel free to ask any help.If you face any problems or need our professional services, please email us at [email protected]

Join our Newsletter

Never miss the latest offers, voucher codes and useful articles delivered weekly in your inbox.