If you’ve been blogging for longer than a few months, you’ve probably heard of the ever so popular site analytics program, Google Analytics.
It allows blog owners to do such things as:
- Discover how your site visitors found your blog
- View how many visitors your blog receives each day
- View areas on your blog where people have clicked
- . . . and a ton more.
If you blog, it’s inevitable that you are going to try Google Analytics at some point. It really is a great analytics program; however, I must admit that it can seem quite complex at times and if you’re new to the program and you might feel a bit intimidated. In the near future I’ll try to post some examples on how to use the program.
When it comes to plugging Google Analytics into your blog, you have a couple of options available to you.
- Download and use a plugin . . . or
- Copy and paste code into your blog’s footer file
Why I don’t like plugins
Simply put, plugins slow down the load time of your website and also pose security risks which could leave your blog open to intruders. Even if the plugin is secure today, it might not be when a newer version of WordPress is released or if the plugin author abandons the program and stops issuing updates.
In my opinion, the best way (and just as easy) to install this is to simply copy and paste Google’s supplied code into your theme’s footer file. That’s it, no plugin, done and move on.
Step 1: Sign up for a new Google Analytics account.

Step 2: Copy the JavaScript code.
During the sign up process you’ll be asked things like your name, email address, etc. At some point, you’ll come to a page that looks like the image seen below. You will will need to copy this code and paste it into your blog.

As a side note, even if you used a plugin to install Google Analytics, you would still need to copy and paste this code at some point; so plugins don’t necessarily make things any easier.
Step 3: Pasting the code into your footer.php file
At this point, log into your WordPress blog and navigate to your theme’s editor by going to Dashboard -> Appearance –> Editor.

Then on the right you should see a list of your theme’s files. Click on the Footer.php file.

Paste the code you copied from Google Analytics just above the ending </body> tag.

Click Update File

And that’s it. No plugins and no worries about updates.
To view your site’s statistics now, log into your Google Analytics account and view your stats. It may take a day or so to start receiving your traffic stats, so if you don’t see it right away, just be patient.















November 3rd, 2009 at 8:54 am
your instruction is very very helpfull and easy
November 3rd, 2009 at 6:51 pm
Hi fazal, I’m glad you found it useful. Thank you for taking the time to let me know you stopped by. It’s always nice to see a new face/name around here.
Don’t forget to add your IP address to the Google Analytics Filter so you don’t record your own visits.
November 12th, 2009 at 1:02 pm
Thank you for the fabulous and SIMPLE explanation of how to get google analytics installed onto my wordpress website without using a plugin. I tried numerous plugins and every one of them gave me the same problems and issues. I followed your instructions and did it correctly myself in about 5 minutes.
I like the old KISS method – keep it simple stupid. forget plugins, they all stink, and so do their ‘newsgroup forum’ style support.
Much appreciated!!!!!
November 12th, 2009 at 9:18 pm
Hi Dan. Thanks for the comment and I’m happy you found the article useful. It really is just as easy as installing a plugin, isn’t it.
I love the KISS method, in just about everything!
January 2nd, 2010 at 3:05 am
Hi John,
Why that is not Save File or Update file button in the Footer (footer.php) platform ? I even change the file attributes but still unable to save the tracking code. Please advice.
Thanks
iris chan
January 2nd, 2010 at 5:37 am
Hi iris, that’s odd, you should be able to edit the footer.php file just fine. The only thing I can think of is your theme is blocking it somehow.
Are you using your own self-hosted WordPress blog, opposed to having a free one on WordPress.com?
If so, log into your web hosting file manager and navigate to your /wp-content/themes/your-theme-folder
You should then see the footer.php file in there. Use your control panel’s file editor to edit the footer.php file by clicking a check mark next to the file and then click “Edit” up at the top.
Then paste the code inside the file as I show in the tutorial, save, and close.
February 15th, 2010 at 8:05 pm
Do you have to install the code on each page of your blog, or only once on the appearance/editor/footer? You didn’t say.
Thanks for the great info!
Gary
February 15th, 2010 at 9:29 pm
Hi Gary. Just once in the footer.php file will do just fine.
My pleasure and thanks for watching.