Jump to content


Photo

Track When Google Crawls Your Website!


  • This topic is locked This topic is locked
No replies to this topic

#1 TCH-Sales

TCH-Sales

    Support

  • Members
  • PipPipPipPip
  • 1,516 posts

Posted 21 August 2003 - 03:10 PM

This script will email you when Google crawls on your domain, or on a specific page (depending on if you pick the simple or advanced versions.) All you need to do is cut it from here, past it into your site and change the "you@youremail.com" to your own personal email account. You can also replace the "******" with the name of your account.

Only rules are your page has to be .php or able to read .php code. You can also place this anywhere in the page, because it will not be seen. Here you go!

Simple Version
The basic bare bones of the script. This one will just tell you that Google was crawling somewhere on your site. It doesn't give you much more detail than that.

<?
if(eregi("googlebot",$HTTP_USER_AGENT))
 {
 mail("you@youremail.com", "Googlebot detected on yourdomainname.com", "Google has crawled yourdomainname.com");
 }
?>

Advanced Version
This is a much better version that will automatically fill in the domain, the actual page (including any query strings), as well as tell you the date and time the page was crawled.

<?
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");
	}
?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users