Google Universal Analytics in Magento
Magento comes pre-loaded with alot of wonderful features that can help you run and optimise your webshop easily and efficiently. Once of them is the integration with Google Universal Analytics.
In case you don't already know, you can use Google Universal Analytics gives you the ability to track, monitor and analyze all visitors and interactions on your webshop. You can read more about it from here.
Before you start using this Google analytics feature in your Magento webshop, you need to create an account at Google Analytics.
Step 1: Go to this link
Step 2: Sign-in using your Google/Gmail account
Step 3: Provide all requested details in the following form and also accept their terms and conditions
Step 4: Once you complete all these steps, you will get a unique tracking id for your website. It will start with UA-XXXX .You will need to save this id in your Magento backend.
Now that you have a GA account and a unique tracking id. You can start with Magento configurations. It is a simple and straight-forward process:
In Magento CE 1.X: Login to backend > System > Configuration > Sales > Google API > Open the Google Analytics block
In Magento OS 2.X: Login to backend > Stores > Settings > Configurations > Sales > Google API > There you will see 'Google Analytics' > Open that section.
Both M1 and M2 have similar fields in this section, so let's take them up together:
Enable: From here you can enable or disable this feature. Select Yes if you want to enable GA tracking on your webshop.
Account number: Here you have to add your GA account number. It is the tracking id that you got from your GA account.
Anonymize IP: Select Yes here to anonymize IP of your visitors. This is an important aspect in protecting privacy of the visitors.
Enable content experiments (M2): You can select Yes here if you want to use Content experiments feature. You can read more about it here.
Note that if you want to use this feature, you have to activate it on Google Analytics end as well. To enable Ecommerce tracking in GA: login to your GA account > click on Ecommecre Settings that is there in the Admin area > Enable Ecommerce
and Enhanced Ecommerce Reporting > Submit.
That is all! You should start seeing your webshop's traffic data in your GA account. You can use the tracking and visitor data to create useful insights that will help you in creating a better shopping experience.