The problem most folks run into though is how do you know it is there? Some forum and blogging scripts come with better ways to track bots as they comb through your pages. What about everyone else though? Well this is where these scripts come in. All you need is to be able to parse PHP through your Web site and you too can track the Googlebot even better.
I am not totally sure who wrote these PHP scripts up first, but I have not seen it talked about many places at all. Hopefully this will a handy tool for you to use.
Easy Version
With this version of the script you need to replace the "yourdomainname.com" with your own domain name and replace "you@youremail.com" with your E-mail address.
Code: Select all
<?
if(eregi("googlebot",$HTTP_USER_AGENT))
{
mail("you@youremail.com", "Googlebot detected on yourdomainname.com", "Google has crawled yourdomainname.com");
}
?>This version is a little more advanced. Here all you need to do is replace "you@youremail.com" with your E-mail address. The script will do the rest of the work. It will let you know which page date and time it was crawled as well.
Code: Select all
<?
if(eregi("googlebot",$HTTP_USER_AGENT))
{
if ($QUERY_STRING != "")
{$url = "http://".$SERVER_NAME.$PHP_SELF.'?'.$QUERY_STRING;}
else
{$url = "http://".$SERVER_NAME.$PHP_SELF;}
$today = date("F j, Y, g:i a");
mail("you@youremail.com", "Googlebot detected on http://$SERVER_NAME", "$today - Google crawled $url");
}
?>[url="http://www.webpronews.com/webdevelopment/basicdevelopment/wpn-37-20040930TrackingGoogleandGooglebotUsingPHP.html"][Source][/url]

