Add to Technorati Favorites

adbits - tell the world

GoogleBot Email Notify

Votes: 745

This code will notify you by email every time Google bot visits your website. It can be very useful when trying to do SEO work, now you can know exactly when Google comes and then review your page rankings and search result positions, and of course make according corrections and tweaks.

 

The code 


<?
$email = "yourname@example.com";
if( eregi("googlebot", $_SERVER['HTTP_USER_AGENT']) )
{
mail($email, "Googlebot Alert",
"Google just indexed your following page: " .
$_SERVER['REQUEST_URI']);
}
?>

Of course you need to change the email address, but it should work fine.  

Source:http://blogoscoped.com/archive/2004_06_23_index.html 

Write a comment

  • Required fields are marked with *.

If you have trouble reading the code, click on the code itself to generate a new random code.
Security Code:
 
Gabe
Posts: 1
Comment
Re: GoogleBot Email Notify
Reply #1 on : Sun June 15, 2008, 19:03:51
Would be more efficient to use:

if( stristr("googlebot", $_SERVER['HTTP_USER_AGENT']) )

as it doesn't involve the regex engine for a simple string match.