I would love to monitor my blog’s traffic so I can get a sense of its readership and stats, but sadly I’m not sure how to go about it. Any recommendations?
-Diana (Soap & Chocolate)
Hi Diana!
I DO have a recommendation. :) One of the most important things you can do when you manage a web site is gather statistics. What’s your most popular content? What search terms do people use to find your blog? When do people read? Knowing this kind of information is not only interesting (at least to this geek) but it can make you a better blogger in the process.
If you aren’t currently tracking you may be surprised to find that one of the most powerful, comprehensive statistic gathering applications is free. That’s right FREE! All it takes is placing a little bit of code on your blog.
Get the Google Analytics Code
Go to the Google Analytics page and sign in with your google account or create an account (note: if you blog on blogger/blogspot the account info should be the same)
Once you are logged in you you will have to sign up for Google Analytics. Click the sign up button. (as of writing this tutorial it’s in the lower left hand side of the screen) Information you’ll need…
- Website’s URL
- Account Name (What ever you want to refer to your statistics as)
- Country
- Time Zone
- Name
- Phone
Once you fill in the information and click next a few time you will be presented with this screen.

The tracking code is all the text in the box starting with <script type="text/javascript"> and ended with </script> Simple copy that code, place it in the template of your blog and click finish! You’re on your way!
Wait. What? You don’t know how do that? No worries! I’m here to help. Now, this step may be different depending on the blog tool you use. I’m familiar with Blogger and Wordpress so that’s the two I will cover.
Installing Google Analytics Code for Blogger (Blogspot)
Click on the Layout Tab.
Then select Edit HTML option.

Under the title Edit Template, You will see a text box with a bunch of HTML code in it. This is the template code of your site. Every page in your blog is based on this code.
Navigate to the bottom of the Edit Template text box until you see
</body>
</html>
Like so…

Now simply put your cursor before the </body> tag and paste the google analytics code.

Click Save Template.
Go back to Analytics and click Finish. It will take 24 hours for your first statistics to appear.
Installing Google Analytics Code for Wordpress
Before I get into the how there is one important thing to note about Wordpress. If you are on Wordpress.com you can not install analytics. They do not allow it for security reasons, plus they track statistics using analytics already and google will not allow two accounts to track the same site.
However if you host your Wordpress blog someplace else then installing the Google Analytics code is a synch!
Navigate to Appearance Tab and click Editor. This may look difference depending on your version of Wordpress. Here’s how it looks in 2.7.
This will bring up a page with a large text box with CSS code in it. However you don’t want to edit the CSS you want to add the code to bottom of your template. To do that click Footer (footer.php).

You’ll know you are in the right place if you see Footer on top of the text box. The text in your footer file may be vastly different then mine depending on your theme. However if you scroll down to the bottom you *should* still see
</body>
</html>
Simply put your cursor before the </body> tag and paste the google analytics code.

Click Update File.
Note: If the </body></html> tags are not in your footer file they may be in Main Index Template (index.php) file. It can vary from theme to theme.
Go back to Analytics and click Finish. It will take 24 hours for your first statistics to appear.
Conclusion
Once you have the code installed wait 24 hours and check you stats back on Google Analytics. The amount of information can be quite overwhelming at first but the collection of the data is invaluable. Especially if you are or will be working with advertisers for your blog.
If you found this information useful let me know. I was thinking of a few more Google Analytics posts to help navigate it and find useful statistics about your blog.
Hope this helps!

Just a food Obsessed loser and blogging fanatic. Here I share my technical expertise and answer questions about blogging. 

Great information! Thanks!
thanks, roni! i was wondering how to do that!
AWE-SOME. Thanks so much! (For the shout-out as well:) ) This is more helpful than I even dreamed of. I will get on this – STAT! :P
Thanks Roni. I have a very quick question…sort of related to CSS…let’s say you want to increase the spacing between your paragraphs, like right now it is set to 1.5 and you want it to be set to 2. How the heck do you do that? Where? I’m guessing its in the CSS, but I don’t see an obvious place. Halp!
Oh, one more question. you say, “if you host your wordpress blog somewhere else…” Huh? What do you mean? Sorry, I know its a dumb question….but really, very green here.
I’ve been using Google Analytics for a while, but one thing I can’t figure out – how the heck do you tell what time people are coming to your blog?
Great resource. I’ve used this other sites and the stats are amazing.
Laura – I’ll put that on the list! :)
Excellent site – thanks for your help!
Hi Roni! Thanks for this great piece of info!
I got the code from google analytics but when I try to add it to my wordpress footer.php I don’t have ‘update file’. Instead I have a text saying I don’t have the required file permissions and that I need to make the file accessible to writing first before I can make any changes. Any idea what I need to do to change this?
Thanks!
Thanks for the great post! I would definitely appreciate more posts on navigating and understanding Google analytics, I’m just starting my blog and not really sure what I should be looking for in terms of traffic, visitors, etc. thanks!
Nathalie – You have to change the permission of the files to allow wordpress access to them. That’s one of those things that depends on you hosting company. This may help… http://codex.wordpress.org/Editing_Files
Thanks Roni!
Actually my boyfriend is hosting it on his server :) He’s a computer tech but he’s more into servers and routing and hardware than htlm and programming, so I’m learning how to make my blog on my own. I repeated what you said to him and he’s working his magic as we speak… it should work soon!
way it works! thanks again :)
Lola – your css question is tough because there are so many ways to do it. You may want to try adding this to your css file and see the result…
p
{
line-height: 1.4
}
As for your hosting question.. some people, myself included chose to host our sites on a different server then just signing up for a wordpress.com account. We actually install the software ourselves.
Hope that helps!
I have found Google Analytics has some great info, but there is NOTHING more accurate than your host data. I have been shocked at the difference and my only guess is because Google requires javascript, enough computers refuse to run it and therefor you lose a lot of potential traffic data.
I just got awstats on one of my two main websites (I’m also a blogging, website junkie!) and it was better than Christmas to have it! Their web traffic was OK but oh how I love awstats!
Thanks Roni. I just added it to both my blogs!
I love analytics. Future posts on this would be great, knowing more about the reports and how you use the info would be interesting. Thanks.
I have a blog and use Feedburner for email to subscribers. Over the weekend, FB started emailing comments along with article posts. Any idea why this happened?
I would love more reports and how to use the information given to us. I do have a question, yesterday Facebook sent me 15 visitors from the Home Page. I followed the traffic source link trying to find out how all these people found my blog but couldn’t figure it out? Any way to see exactly the link they clicked on from Analytics???
Laura… I got you.. :) http://skinnyminnymedia.com/new/2009/04/04/find-out-when-people-read-your-blog-with-google-analytics/
how easy was that? you are great at explaining and it is most appreciated!
You rock! Thanks for the help on this! I just started my blog and I’d love to get your feedback: http://the23yearoldpublisher.blogspot.com/.
My biggest piece of advice… customize if you can. Distinguish your blog from the default templates. :)
Looks great!
Thank you! Seems like everywhere I went on the web there was an assumption that I knew instinctively where to find that tag!
Great site, how do I subscribe?