Newest Industry

Evolving the Online Performance Experience

When the tracking site goes down…

leave a comment »

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.

Written by Stephen

December 17 2004 at 12:28

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 274 other followers