WordPress Plugins: WordPress.com Stats and Google Analytics

When I redesigned my site at the beginning of June I added two new plugins for collecting site statistics. Both share the ability to exclude logged on site admins so my own site visits are ignored. The first is WordPress.com Stats by Automattic (so sometimes listed as “Automattic Stats”) and the other is Google Analytics by Denis de Bernardy.

WordPress.com Stats

WordPress.com Stats requires you to have an account at WordPress.com, although you do not need an actual blog there. The Stats are hosted on their servers. Also, you’ll need an API key from Automattic. If you have one for Akismet you can use the same key, and if it sees the key in the DB it will offer to use it.

Assuming you don’t already have an API key you can go here for instructions on how to get one. This process will also give you an account on WordPress.com.

One you have the API key you simply upload stats.php to your plugins directory and activate it in the plugins admin panel in your WordPress blog. You’ll be prompted to enter the API key, or use one it finds. They say it takes about 20 minutes for stats to start showing up which I found to be fairly accurate. My busier blog showed activity in about 15 minutes while my less active blog showed activity in about 30 minutes.

Stats are viewed by selecting “Blog Stats” on the Dashboard menu in your WordPress blog admin panel. This redirects you to your WordPress.com admin panel and you’ll be prompted for an ID and password unless you told it to remember you.

There’s a graph showing views over the last 30 days (but only from when you started collecting stats). The top 10 posts for the current and previous days are shows along with the number of views. All times are GMT so “today” and “yesterday” are calculated based GMT. You can also drill into the top posts and get daily reports for the past seven days. These list more than the top 10 posts but still eventually truncate the least viewed posts if you have a long list. You can also get summary reports for pages viewed in the last seven or last thirty days. On any of these post views there’s a graph icon next to each post listing, clicking it displays a 30 day graph of views for the post.

The main page also displays a list of referrers for the current and previous days. This also has the ability to drill into the detail but it ends up being one of the bugs in the plugin. Drilling in shows a heading “Referrers for 7 Days…” but only the current day’s referrers are shown. Even the previous day’s referrers that were shown on the previous page have been dropped from this report.

Search engine terms used to find the blog are also shown. Again, on the main page they’re shown for the current day and yesterday. But again, drilling into them results in a header that says “Search Terms for 7 Days…” but the result is only the current day’s terms. In my case I had sixteen referrals for one search term yesterday but it didn’t make the seven day drill down even though the top search term for those seven days had only two uses and only contained what appeared to be the current days referrers. It clearly should have been there.

Finally rounding out the major stats, the clicks on the blog are also tracked. This seems to only track outbound clicks. And again, the drill down has the same issues as search and referrers.

The plugin also keeps track of total views and the “best day ever”. It also lists a couple of recent incoming links while clicking “more” brings you out to a Google Blog “links” search.

If you have multiple blogs which use the same API key you can jump between them by picking the blog from a drop down and clicking “go”.

I also found some problems that appear shortly after midnight GMT. The “Today” and “Yesterday” stats for search, referrers and clicks are identical for a period of time although eventually they become distinct. It appears the daily rollover isn’t clean until some time passes or enough news stats are collected. Although the amount of time I’ve waited seems rather random. But since I need to be at my computer at a specific time it’s been hard to track, especially since it’s not a minor issue.

Summary: The graph of views and the simple metrics for post views makes WordPress.com Stats worth using for me. It provides a quick view of what’s recently active along with quick insight into the 30-day trend overall or for a specific page. The bugs in the referrers, search and clicks does leave gaps in it’s ability.

Google Analytics by Denis de Bernardy

In a bit of irony, prior to the redesign I used a theme by Denis de Bernardy but not his Google Analytics plugin. My main reason for switching to this plugin was it’s ability to ignore my own site visits. The plugin actually excludes visits from all authors, editors and site admins if you have a blog that uses these various roles.

You’ll need to set up a Google Analytics account before you can use the plugin. Once you do that you simply copy the contents of the plugin download to your wordpress plugins directory and activate it. Since there are two files I copied the directory contained within the zip to my plugins directory. Then, in the admin panel, locate “Google Analytics” on the “Options” menu. Paste the tracking code provided by Google Analytics into the box provided. You can also simply type your tracking number in the space provided since the code template is already there. In my case I simply replaced all the code with cut/paste from Google Analytics.

I’ve tested the ability to exclude my visits by viewing some obscure pages and Google Analytics did not report the views. Also, prior to activating the plugin my admin panel usage was tracked. This dropped to zero when I activated the plugin.

Most of my usage was with version 2.2 of the plugin. Version 2.4 is now available. The latest version uses roles rather than levels so isn’t compatible with WordPress pre-version 2.

Summary: The plugin has no purpose unless you use Google Analytics but if you do the plugin does a good job of limiting the stats to visitors. For those of you who are anti-Google Analytics (because it gives Google too much info) Denis also has a similar plugin for HitsLink which is a paid tracking service.

Additonal Information

You can find additional information about Plugins and WordPress on my WordPress page.