Jeremy Smith's blog

Entry Is Labelled

Preliminary Per-Site Blog Traffic Statistics

I've finished a first pass at setting up per-blog traffic statistics. If you notice, you can now go to and get at your log files. The current week's log file will always be called access_log and will be rotated on Sundays. 4 weeks worth of logs will stick around in gzip'ed form located at access_log.YYYYMMDD.gz. So, now, anyone can have at it; download their statistics; and run whatever log analysis tools they would like. And, it's easy enough to cron a daily shop to grab it a la:

perl -MLWP::Simple -e 'get("");'

And, then, obviously, add in whatever other code you want to perform your analysis.

Of course, we've already done some pretty graphs for you using AWStats. To view your stats, you can use the URL form: So, mine are at I plan on cleaning those URLs up via some mod_rewrite magic, so they end up looking like, but I haven't done that yet.

I just got mod_log_sql installed and configured recently, so the stats start off on Sunday (when I got it completely running). Not much there right now, is what I am trying to say. But, that will obviously change as time goes on.

If you have any feedback, questions, or thunderous praise; leave a comment.

[Update: I have the mod_rewrite directives working. You can now use a URL of the form to access your blog's traffic statistics. So, for example, my stats are located at]


  1. gravatar

    Well done Jeremy. We've been thinking about doing per blog stats for a while, but have not taken the plunge.

    The reason being is that we're not sure if it will discourage or encourage our users. A great deal of the reading of Warwick Blogs is done via our "show all" page at, and with that, there is no way of knowing if someone has actually read your entry or just skimmed past.
    You'll have to let everyone know if you find that people who discover they have few/no readers give up blogging or don't mind.

  2. gravatar

    I tried to look up the stats but just got a whole lot of garbled text.

    Is this because I am using a MAC? I tried with both Safari and Explorer browsers.

    p.s. I just tried it out on a Windows machine and got the same result.

  3. gravatar

    I think my problem was that I was looking only at the log files. But the graphs came out very nicely. Great work!

  4. gravatar

    I looked at the statistic and was wondering what the distinction was between 'hits' and 'number of visits'.

    Also, what constitutes a 'page'?

  5. gravatar
    what the distinction was between 'hits' and 'number of visits'.

    Also, what constitutes a 'page'?

    AWStats has a glossary here – – that should explain the distinctions.

  6. gravatar

    In addition to my own blog (bcg8), I am a co-author for the KSL Reference Weblog ( How can I view the stats for this group shared blog?