My first Google number one!

This blog isn’t even the top Google result for my own name, so it seems odd that I should be at #1 for something as generic-sounding as snow over london

snow over london on google

edit 27 Dec 09: Looks like this post is now completely inaccurate - this blog is now #1 for my own name, and is no longer #1 for “snow over london”. Oh well, it was fun while it lasted!

Selectively Disabling Analytics on Wordpress

So, you want your Google (or other) analytics to accurately represent the visitors to your WordPress site, rather than the 20 times you loaded it to test a new widget? Here’s how to turn off your analytics Javascript(s) for your own visits, thus preserving the sanctity of your reports:

  1. Find out what your Wordpress login cookie is called

    This is where the Web Developer plugin for Firefox comes in handy. Make sure you’re logged into your blog, and go to Web Developer -> Cookies -> View Cookie Information. Scroll down until your “wordpress_logged_in_[hashstring]” cookie appears (I am not entirely sure what the long hashstring in the cookie’s name represents, but it seems to stay the same for the given user). Copy the cookie’s name.

  1. Find the analytics code in your theme

    I keep my analytics code in footer.php, and I recommend that you do also.</li>

  2. Write a little PHP magic

    Before the analytics code begins, write this line:

    <?php if(!$_COOKIE['{cookiename}']): ?>

    and after it, write:

    <?php endif ?>

    This will prevent the analytics code from being loaded, thus hiding your visit from your reports. It might be desirable to always have the option of turning off analytics, though: perhaps you’re checking the blog from a friend’s computer and don’t want those hits to show up. Here’s how to do it:

  3. Decide on a suffix for your URL

    The suffix will be in the format “?{suffix}=true”. You can make this as easy or as difficult to remember as you want, but let’s presume you want to use “hideme”.

  4. PHP magic

    Change the above if statement to:

    if(!$_COOKIE['{cookiename}'] and !$_GET['hideme']):

  5. Browse, silently

    Go to - your analytics provider will never know.

Snow Over London, Revisited

February brought a big surprise, when snow fell on London and the city came to a halt. I took some photos around Waterloo/Southbank, and after a considerable delay, I have now put them online. Here they are!

Snowy London

Google Now Has Realtime News Updates

Not that I care about the Tiger Woods scandal, but if I did, I’d be able to see acres of gossip and analysis unfold before my eyes - and I wouldn’t need to refresh my browser, or even go to Thanks Google!

Real-time Google results