This article will show you how to add the Google Analytics code to your wordpress site.
1. First you need to create a Google analytics account
2. Once you have the tracking code, copy it and log in your wordpress account. In the administration panel of wordpress, go to “Appearance” and “Editor”
3. Once you are there, find the “header.php” and open it by clicking on it. Copy the code you obtained in the last step of this tutorial before the closing </head> tag and click on the blue button that says “Update file” to save the changes made on the header.php file.
You want to paste the google analytics code on the header of your pages, so if the user leaves your site before the entire page loaded, you will still get the data in google analytics.
(Click on picture to enlarge)
and you are done!
It will take a few hours/days for google to index your site, but when it is done, if you return to your google analytics account and click on “F5” to refresh the page, and if you have done everything correctly you will see: