Jump to content

Recommended Posts

Posted

Simple script that you can insert in a .php page that will email you when Google is indexing your site. You will need to change the values in the script for your own site and contact details.

 

Simple version

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

Posted

I use this script myself. One time, I decided to include it in every page and I got bombarded by hundreds of emails.

 

One idea would be to put it on your site map, home, and maybe one or two other pages that you want to track. (New page, for example.)

 

Adding extra bots wouldn't be hard. Maybe Dsdemmin and myself could work on such a script for TCH members. We'll see.

Posted

I put the script on my index page and changed it to index.php. I put a redirect in the .htaccess file to reflect the change from index.html to index.php. Then I clicked on the link for my Family Tree and got my main index.php page ^_^ So I ended up taking out the redirect then I could click on the link and be taken to my Family Tree site... :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...