April 4th, 2008
Google Analytics and Blog Stats
written by Keith James LockIn this post I'm going to cover a couple easy ways to add stats tracking to your blog. First I'll get into Google Analytics and then the Wordpress.com Stats plugin.
It's very important, as I'm sure you're aware, to keep an eye on the stats for your site or blog. You can find out things like; what sites are linking to yours, what keywords are used to find your site in the search engines, how many visitors you are getting, how long they are staying, what pages they are looking at, etc. In the past, I used to rely on whichever stats program my web host had installed. These days I use Google Analytics and more recently I installed the Wordpress.com Stats plugin.
![]()
Adding Google Analytics Code
You can login to Google Analytics using your existing Google Account if you have one. Head over to http://www.google.com/analytics/ to either login or create an account.
To add a new web site:
- Click add web site profile
- Type the URL and click continue
You will have two options for code to add to your site. The analytics software used to be owned by Urchin and the Urchin code still exists. They have since added Google code. I imagine at some point you might be forced to switch to the Google code so you might as well copy that code rather than the Urchin code.
- Click new tracking code (ga.js)
- Copy the JavaScript code to your clipboard
- Click Finish
Now you must paste the code into the footer section of your site, just before the closing body tag. It must be added to all pages that you want to track. For Wordpress this will be easy, you just have to paste in one location.
- Login to your Wordpress admin area
- Head over the Theme Editor (from the Design menu in Wordpress 2.5)
- Choose Footer from the file list on the right side
- Paste the code just above the closing body tag near the bottom of the file
- Save the file
Data will now start to collect in your Google Analytics account. To learn more about Google Analytics play around with the reports in there and sign up to the Google Analytics blog.
Wordpress.com Stats Plugin
The Wordpress.com Stats plugin is pretty cool. It's not as complicated to master as Google Analytics. The data is viewed right from your blog's dashboard. You need to get a Wordpress.com API key to use it or use the same one that you used for Akismet (Comment spam control). That's all I ever do. I use the same API key on all my blogs.
Getting The API Key
Check for the Akismet key first. There's an Akismet Config link at the top of the plugins section. Click that and you'll see the key. If you need to get one, create an account at Wordpress.com. I forget the exact steps but it's pretty straightforward. You don't have to create a blog on Wordpress.com for this, just an account to get your API key. Once the account is created they will email you the key. If you already have an account you can find your key on your profile page which can be found by clicking "My Account" after logging in.
Installing Stats Plugin
You can read more about the plugin and download it from here. It's simple to install. Nothing fancy. Here are the quick steps:
- Upload stats.php to your /wp-content/plugins/ directory.
- Activate the plugin through the 'Plugins' menu.
- Enter your WordPress.com API key you grabbed earlier, probably sitting on your clipboard ya?
- Check the dashboard for the stats...most popular posts, incoming links, outgoing links, that sort of thing.
|
Subscribe & Share |
Related Posts |

Adding niche posters to the sidebars of your BANS sites has HIGH conversion potential! Signup now!







April 5th, 2008 at 8:21 am
Great post Keith! Had both of these up and running in minutes! I can’t wait to see what the stats show now! Thanks again for sharing your knowledge to help us out!
WaiverSharks’s last blog post..WELCOME
June 2nd, 2008 at 9:15 am
Thanks for the article. A couple of questions: do you use both or is one better than the other? Also, is there a load penalty on WP with the tags in place?
June 2nd, 2008 at 9:47 am
I use both. Only because it’s nice to see some stats at a glance from the Dashboard. But I like GA because of the advanced data that is collected. For some bloggers, WP Stats is sufficient. I’m not sure what you are asking about the load penalty sorry.
Thanks for the comment.