I have already posted a WordPress plugin recommendation on the plugin “Google Analytics for WordPress” and it works great. But there is a few things that I personally find annoying. First of all, it not only adds the Analytics code to the header, but also “Powered by blah blah blah” and I find that egotistic of the developer. Secondly it’s the general placement of the code, in the header, which means that the visitors web-browser will load that as one of the first elements of the page. Which will slow down the download of the main content, which is very important to me. Next I will show you how you can add the code manually to your WordPress footer.
The first thing you need to do is to get your hands on the Google Analytics tracking code, and you can do that by first going to Google.com/Analytics and logging in. Then you need to click “Edit” to the far right of your profile. Then click “Check Status” in the top right corner and there you have your tracking code. Copy the code or leave the webpage open cause we will need it later.
Now, go to your WordPress dashboard (admin panel) Appearance > Editor and click “Footer (footer.php)” on the right side of the page. Scroll down in the editor window and paste in the Google Analytics tracking code in between the </body> and </html> tags, so that it looks like this:
Click “Update File” and you’re done! Remember that it may take 24h or more before the Google servers update properly.