Tag Archive for 'statistics'

Some more stats

Mint statsI like stats. We all like stats in some form or other. It brings order to often disorganised information.
My website has been taking a lot of hits recently, far over the normal amount of traffic I get. To the left should show that quite clearly.

Bus statsAll of those extra hits have been for one particular post I made. Hampshire police bus. As you can see to the right, I’ve had close to 10,000 hits just for that post.

Apc has been taking a lot of weight off the shoulders of my server (1.24 million hits!). Admittedly, my server doesn’t just host my website, but several other popular websites too. The user cache variables are from my websites only though.

APC stats

I’m pretty thankful I run APC, mod_deflate and WP Super Cache. Without any of these my server would probably be struggling. I’d also recommend the WordPress APC object cache for those who use WordPress and have APC installed.

They like me

I must have done something right. I’m currently getting 300 - 500 unique hits per day to my website by people searching for Spider Pig. It’s not just Google either. Add to that Yahoo, AOL, MSN, BBC, etc etc.

Spider Pig Stats

I wonder if this popularity is anything to do with the advertising request I got via email today.

Our company has an ad program that buys ad space on your website with no cost to you.

mmm. No cost? They obviously don’t think of advertising as an obtrusive cost to the viewer. Sure it pays and helps in a lot of areas, but it doesn’t half look ugly. This place will always be ad free.

WordPress Stats

You’re now able to use Automattic’s WordPress stats system for your self-hosted WordPress blog. This could be pretty neat for those not wanting to clog up their hosting with additional stats tracking programs. I’m quite happy with Mint for my stats at the moment though.

The 404

I’ve been working on a 404 error page for the theme that I use here, Subtle.

I wanted to add error page support to the theme so I could utilise the error tracker plugin for Mint and also get search engines to adjust their listings for the website.

I wrote a funky bit of PHP code, which was inspired by A List Aparts: The Perfect 404 post.
What it does is look for a referral from a listed search engine and then get the keywords used in the search. It then assigns those keywords to the variable $new_search . That variable can then be used to populate your own search form.

< ?php
// Here we do some intelligent search engine 404 checking
// This allows us to show some links to possible relevant content
 
if(strlen($_SERVER['HTTP_REFERER']) > 0) {
 
    // We have a referer value somewhere
    // Look for a search engine query
    $engines = array('google.co', 'looksmart.co', 'altavista.co', 'msn.co', 'yahoo.co');
    for($I = 0; $I < count($engines); $I++) {
        $found = strstr($_SERVER['HTTP_REFERER'], $engines[$I]);
    }
    if(strlen($found) > 0) {
 
        // We have a search engine..
        // Split the referal up to get query used
        $query = explode('?', $found);
        $parts = explode('&', $query[1]);
        $part_count = count($parts);
 
        // Find specific search terms based on differing search engines
        $style = array('q=', 'p=', 'ask=', 'key=');
        $style_count = count($style);
 
        // start by looping through the URL parts
        for($s = 0; $s < $part_count; $s++) {
 
            // Match url parts against search query types
            for($t = 0; $t < $style_count; $t++) {
                $terms = strstr($parts[$s], $style[$t]);
                if($terms == true) {
 
                    // finish loop as we've found what we need
                    $s += $part_count;
                    $t += $style_count;
                    $terms = explode('=', $terms);
                }
            }
        }
        // Search terms to echo in the search box
        $new_search = str_replace('+', ' ', $terms[1]);
    }
}
?>

I’m sure the code could be tidied up a bit, but it does its job. Feel free to use it for your purposes!




Close
Powered by ShareThis
lotsa emails this way!