Googlebot Can Execute JavaScript on Web Pages

Written by Amit Agarwal on Mar 23, 2009

Googlebot, the web spider that crawls web pages for inclusion in Google’s search index, can sometimes run JavaScript code as well in addition to fetching text content from a web page.

googlebot with google analytics

Here’s why – my Google Analytics report for Web browsers says that 500+ visits to the site were made using Googlebot 2.1 browser which is actually the code for the user-agent for Googlebot.

These Googlebot visits can only be recorded in Google Analytics if the JavaScript code of Google Analytics on those web pages was executed by the Googlebot.

While it is possible that that some people may have changed the user-agent of their web browsers to mimic Googlebot, that is not the case here because even Statcounter recorded the Googlebot visits with more detailed information including the time it spent on the whole site for that session.

googlebot useragent details

Am not sure how Googlebot determined web pages where it had to run the JavaScript code but this could be of some interest to AJAX based websites.

Document Studio

Generate beautiful and pixel-perfect documents in PDF, Word, Excel or PowerPoint.

Download New
Mail Merge

Send personalized emails from Gmail, include unique attachments, track opens and more.

Download Popular
Save Emails

Download email messages and file attachments from Gmail to your Google Drive.

Download Popular

Subscribe to our Email Newsletter