When the tracking site goes down…

So, what is a geek to do when SiteMeter goes down? He writes his own tracking code and embeds it on his blog page!

Really simple PHP Code:

<?php
include([DATABASE CONNECTION INCLUDE]);
$logtime = date("YmdHis");
$ipquery = sprintf("%u",ip2long($REMOTE_ADDR));

if ($REMOTE_ADDR != [EXCLUDE SOME IPS]){
        $query2 = "INSERT into logger.blog_log
values ($logtime,$ipquery,'$HTTP_USER_AGENT','$HTTP_REFERER')";
        mysql_query($query2) or die("Log Insert Failed");
        mysql_close($link);
}

print "<META HTTP-EQUIV=Refresh CONTENT="0; URL=[IMAGE FILE]"/>";

?>

Then I create a table in my logging database to trap the results. Once I have that, I created an IFRAME call in an MT Typelist and away we go!

There is always a geeky solution to a customer service issue. If this works, I will cancel my SiteMeter subscription.

Leave a Reply

Your email address will not be published. Required fields are marked *