Google Analytics is still the most used traffic analysis tool on the planet, although it seems a little bit old and slow for these times (it loads at a slow speed and shows the actual data few hours after any events occur on your website … ). WordPress & Google Analytics can work well together if you do it right.
Right now I’m using a plugin to add google analytics to my website, but there are few other ways to do that, depending on your imagination :).
First, let’s talk a little about this plugin. You can download it for free right here: Download Google Analytics for WordPress
Next, upload it to your “wp-content/plugins” folder and activate it from your plugins page in wp-admin. Once this plugin is active, you will have a new button in your settings sub-menu. Click on it and you’ll see this screen:

Here you can paste your google analytics code. Please note that this plugin works with the old version of GA as I marked with red in the screenshot (I hope in the near future we’ll have a version that will support the latest script from google). Hit update options and you’re done.
Another thing, if you’re logged in, this plugin won’t show the code in your page, so if you want to check it’s there, you need to logout first.
A second option would be to edit the theme files. This is good and bad at the same time. Good because you don’t have to get stuck with uploading plugins and so on, and it’s bad because it won’t work once you update your theme (or switch to another one). So it’s up to you if you use this method or not.
Here’s how to do this: first, you have to know what files from a WordPress theme are used always. These files are the header and the footer (the others might be used or not while user navigates on your website). Therefore, you may put the google analytics code inside one of those 2 files. I recommend editing the footer.php file because google instructions say that you have to place their code before the </body> tag. We’ll do so.
To edit your footer.php file, go to “Design” \ “Theme editor” and select “footer.php” from the right column. Once it’s loaded in the textarea, paste your code before the </body> tag, just like in the image below and hit the “Update file” button.

That’s it. You have installed Google Analytics on your WordPress Blog.
- Peter
(You can find an update for this post here)