Tracking Googlebot with ColdFusion
<cfif findNoCase("googlebot", cgi.HTTP_USER_AGENT)>
<cfmail to="[email protected]" from="[email protected]" subject="Google has crawled yourdomainname.com"></cfmail>
</cfif>
Expert Version<cfmail to="[email protected]" from="[email protected]" subject="Google has crawled yourdomainname.com"></cfmail>
</cfif>
<cfif findNoCase("googlebot", cgi.HTTP_USER_AGENT)>
<cfset today = dateFormat(now(), 'dd/mm/yy')&timeFormat(now(), 'HH:mm:ss')>
<cfset urlString = "http://"&cgi.SERVER_NAME>
<cfif len(trim(cgi.QUERY_STRING))>
<cfset urlString = urlString&"?"&cgi.QUERY_STRING>
</cfif>
<cfmail to="[email protected]" from="[email protected]" subject="Google has crawled yourdomainname.com">
Google Detected @ #urlString#
</cfmail>
</cfif>
Warning: they are not tested yet so use at own risk.Obviously this has a few other uses, it could even be modified to see when the MSN bot or all of them coming across.<cfset today = dateFormat(now(), 'dd/mm/yy')&timeFormat(now(), 'HH:mm:ss')>
<cfset urlString = "http://"&cgi.SERVER_NAME>
<cfif len(trim(cgi.QUERY_STRING))>
<cfset urlString = urlString&"?"&cgi.QUERY_STRING>
</cfif>
<cfmail to="[email protected]" from="[email protected]" subject="Google has crawled yourdomainname.com">
Google Detected @ #urlString#
</cfmail>
</cfif>