Google Analytics Code in Magento 2.0
After you follow the steps from their tutorial, you will get a code that looks like the following:
UA-AAAAA-A is a unique code that was given to your store by Google.
After you generated the code (UA-AAAAA-A), you need to add it on your website. In order to do so, follow a few simple steps.
Log in to your admin panel and navigate directly to Stores => Configuration
Then under Sales, find Google API.
Now click to expand Googla Analytics section, select “Yes” to enable and enter the code (UA-AAAAA-A). Don’t forget to press “Save Config”.