Would you like to know when the Google spider or any other spider comes by your site? Well now you can with this handy snippet. It will send you an email for everypage it visits.

<cfif CGI.Http_User_Agent CONTAINS "googlebot">
    <cfmail from="info@yoursite.com" to="you@yoursite.com" subject="The Googlebot came to call" server="smtp.mailserver.com">
        Google has visited #CGI.Script_Name#

Put this in your application.cfm file in the root of your site. Then every page it visits you get an email, be sure to change the following code to yours;

info@yoursite.com = your email
you@yoursite.com = your email
smtp.mailserver.com = your mail server ex. mail.yourdomain.com

You can even change the script to alert you to other visits by other spiders, all you need is a list of other bots!

Try this list;

13 Years
Discussion Span
Last Post by jsmall26

I dont know that i'd put it in the application file. Maybe the index.cfm page, but the application.cfm will be called for every page in that directory and if its in the root of your website, you'll get a TON of emails. That's just my 2 cents though. :)

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.