« Displaying an RSS Newsfeed on Your Site | Main | Weather »

Site Statistics

Updated February 22, 2007

There are several ways to get statistics about your Movable Type weblog. Most web hosts give you access to some statistics regarding your site as a matter of course - referral logs (list of sites that link to you in which someone has clicked on the link to get to your site), number of hits, number of page views, etc. If you want more information, i.e. the search terms used to find your site, the most recent entry pages to your site, the mix of browsers and OS platforms of those viewing your site, the length of time people spend on average on your site, you can use a site statistics service, also known as a hit counter. These services work by having you put a small piece of code on the pages of your site that you want tracked. There are several free services available that have you place a small image file on your site that links back to the service statistics page where you can see your site statistics. For a fee, you can make the image go away and make the statistics invisible to anyone but yourself.

I have found a few free services to recommend.

  1. Google Analytics. Google Analytics from Google is probably the best free service available. The free service offers more statistics and analysis of those statistics than most site owners will ever need.


  2. Site Meter. I use Site Meter (www.sitemeter.com) on my recipe site and now I've added it to Learning Movable Type (scroll down and you'll see a small rainbow colored box on the left). It gives me statistics on visits and page views (per day, week, month, and year), most popular entry and exit pages, breakdown on browser and OS platform types, and time zones and languages.
  3. ServuStats. ServuStats (www.servustats.com) provides more free interesting statistics than Site Meter including search engines used, search query terms, and the screen resolutions of your visitors' monitors. One issue with ServuStats is that when you click on the ServuStat button to get statistics, not only do you go to the stats page for your site, but a huge advertisement pop-up shows up behind the other open browser windows. A downside to the ServuStats javascript code is that it will cause any page on which it is located to not validate as XHTML valid.
  4. Bravenet. Similar to Servustats, Bravenet.com offers a slightly different mix of stats - no search terms, but tracks the difference between first-time visitors and returning visitors. Clicking on the Bravenet button also generates pop-ups.

Please let me know (in the comments below) if you are using another site statistics service that you can recommend. (Please no ads).

AWStats - Advanced Web Statistics software package for hosting the actual stats software on your site.
Extreme Tracking - similar to Site Meter and ServuStats.
Nedstat - puts links to sites using Nedstat on home page.
BlogPatrol - similar to Bravenet and ServuStat but without popups.
StatCounter - invisible web tracking.

Comments (8)


Thanks for all the tutorials on this blog! I am also trying ServuStats for my blog but I prefer to keep the stats private. I haven't been able to figure out how to edit the javascript yet, so as a workaround I added a little html/css code that simply positions the image off the screen. Depending on where the image is initially on your screen, you may have to adjust the number. To view my stats, I just bookmark the Servustat website and login there.

Locate the site tracking code in your main index template and before the line with <script language..., add:

<div style="position:absolute; left:-200px;">

Then go to the end of the code, and between </script> and the last line, add:


Save and rebuild indexes as per usual. That's all there is to it! I don't know how Netscape would react to that.

Thanks Suzanna for the tip!


Hi Elise,

You've become my first stop for MT-related tech-queries. I've found that you provide great information that's not too technologically advanced (much of it is still above my current level of understanding but it doesn't assume you know how to run a cron job, or write a custom php index for example). Are you related to 6-apart in any way? If not, they should give you a kick-back haha!

Anyway, on-topic I discovered this VERY useful site that is like the "consumer reports" of web-trackers. I found that I NEEDED something like this, because the nuances of comparing so many available statistics from several different services was a database I just wasn't able to juggle mentally. Check it out here: http://tellertest.com/en/rapport.php?en=&sort=total
that linked version is sorted by overall score, but you can resort it by several different indicators.



One more link: This is a great essay-based introduction to the site that I linked in the above comment. "The perfect tracker" Highly recommended (=

Having just read your Site Statistics tutorial, I thought you and your readers might be interested in another idea. You may already know about this.

I've been running it on my main blog for a couple years.

Two main benefits are, it's free and there's no button to display. The downside is, since it runs on your own server, the log file can get quite large on sites that get a lot of hits. Of course, it's easy to delete the log and start a new one.

Anyway, here it is:



How do you use Google Analytics with MT though? I've put the code in above the /body tag (on index.html page) as instructed, and its not recognised.

Within Google Analytics help pages there's instructions how to enable on Java, but I thought MT was written in Perl?

Any suggestions how to solve this would be appreciated. Thanks.


Hello Elise.

I am thinking about an MT Stats page - meaning the stats of our blogs, not visitors. This is, for example, how many entries or comments we have on our blog.

The scripts for this kind of thing are already inside the tmpl files, but someone (like you) who know where they are located at must compile and edit them.

One example is:

<ul class="user-stats-list">
<mt:if name="last_post_id">
<li><__trans phrase="Your <a href="[_1]">last entry</a> was [_2]." params="<mt:var name="script_url">?__mode=view&amp;_type=entry&amp;id=<mt:var name="last_post_id">&amp;blog_id=<mt:var name="last_post_blog_id">%%<mt:date ts="$last_post_ts" relative="1" offset_blog_id="$last_post_blog_id">"></li>
<mt:if name="draft_count">
<li><__trans phrase="You have <a href="[_1]">[quant,_2,draft,drafts]</a>." params="<mt:var name="script_url">?__mode=list_entry&amp;filter=status&amp;filter_val=1%%<mt:var name="draft_count">"></li>
<mt:if name="publish_count">
<mt:if name="comment_count">
<li><__trans phrase="You've written <a href="[_1]">[quant,_2,entry,entries]</a> with <a href="[_3]">[quant,_4,comment,comments]</a>." params="<mt:var name="script_url">?__mode=list_entry&amp;filter_key=my_posts%%<mt:var name="publish_count">%%<mt:var name="script_url">?__mode=list_comment&amp;filter_key=my_posts%%<mt:var name="comment_count">">
<li><__trans phrase="You've written <a href="[_1]">[quant,_2,entry,entries]</a>." params="<mt:var name="script_url">?__mode=list_entry%%<mt:var name="publish_count">">

But I don't know how to edit this.

I am sure a lot of bloggers would be interested in putting blog stats somewhere in their right columns, and it would be highly appreciated.


@Alison - Google Analytics works fine on MT blogs - but you'll put this on the output pages, not the back end (you can add it to your admin pages, but that will just track your authors visits not your site visitors). To do this, add it to your templates and rebuild your site.

@SK - There is a Google Analytics plugin for MT4 that allows you to view your stats in a Dashboard widget. Not sure if this is what you intend or not, but it might give you a starting point!

Post a comment

(If you haven't left a comment here before, your comment may need to be approved before will appear on the entry. Thanks for waiting.)