Find out when Googlebot visits your page

Friday, March 5, 2010

I was talking to some guys in the business the other day about SEO. I told them about this little piece of script I found years ago that shows when Googlebot comes around your site to visit by sending an email to you. I was amazed that these guys had never heard of such a script or tool. I mean doesn’t everybody want to know when Googlebot has paid a little visit to your site?
Anyway, for all of those who don’t use this yet, this is the one I use. Just put it in your header, footer or whatever.
if ( strpos( $_SERVER['HTTP_USER_AGENT'], ‘Googlebot’ ) !== false )
{
// The email address we want to send the email to
$email_address = ‘YOUREMAIL@EMAIL.COM’;
// Send the email
mail($email_address,’Googlebot Visit’, ‘Googlebot has visited YOURSITE.COM: ‘.$_SERVER['REQUEST_URI']);
}
?>

No comments:

Post a Comment