little PHP script to track the Googlebot

Just a little bit of script to track when the Googlebot comes visiting. Just put it in your page somewhere and, voila, you’ll get an email to let you know.


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:

Equally, you could change the email part of the script to record the visits to a database, along with any other information you may find useful. Saves dealing with emails, and enables a lot more analysis etc later on if you want.


About Cameron
I'm a final year Computer Science/Information Systems major. Already finished my BA in Politics/Philosophy. I do web and software freelance on the side, while I finish studying. Hoping to be self-employed by the end of my degree, otherwise off into the real-world I go....

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: