Monday, January 28, 2008

Detecting the googlebot

Detecting the googlebot as your site's visitor is easy by just checking user agent. Googlebot uses this user agent:
Googlebot/2.1 (+http://www.googlebot.com/bot.html)

And in the app, we can just check:
request.user_agent =~ /googlebot/i

No comments: