Google's complicated realtionship with Client Side Scripts
Overall the results are quite confusing, but lead me to make some strange, possible conclusions..
- Googlebot CAN execute, and read the results of, AJAX requests
- Googlebot CAN NOT store/read Cookies
But the killer is:
DOES NOTDOES use this information in search relevancy calculations
And, as we predicted, the cookie is not set, telling us that the Googlebot didn’t/can’t read cookies.
The ability of the Googlebot to read the JS and Ajax is not immediately obvious.
Indeed if we take the first string: and search for it in Google, we get no results. Try it yourself.
When you check out the page preview, the search query “so… Relentless Marauder becomes…” is highlighted.
But the only place that you can see evidence of that is in the page preview section, which is quite strange.
On the results page here we see Google showing us two different interpretations of the content of our page. Ok in this case it is only 2 words, but theoretically it could be a huge difference.
If we take the second test string: and run another Google search for that phrase we see a strange result Try it yourself.
As you can see, the search returns the file that contains that string. On the main test page we call this file with an Ajax call and show the contents. This file is not linked from any other page which would lead me to think that the GoogleBot has understood the structure of the Ajax request and sent off a spider to grab the contents of the file.
Whilst I can’t completely rule out that the GoogleBot got there via an external link, I think given the time frame and obscurity of the file location, this is very unlikely.
With the third test string we also run some referrer filtering to make sure that the text is only output when it is called via an Ajax request into the main page.
Again this file was found and indexed See here
But, again, when we run a search for the text prior to the expected string, we are presented with the ajax text shown in the page preview but not in the snippet. Try it Yourself. This is perhaps the strongest evidence I have seen yet that, in some way, the GoogleBot DOES execute Ajax requests and CAN read the resulting output.
The fourth test yielded no results whatsoever, backing up the idea that the Googlebot CAN NOT store and read Cookies (which is good as its the main premise behind my other post “Faking Backlinks using the Referrer“).
Why is this?
Finally I would like to say a big thanks to everyone that helped spread the previous post, it was great to get feedback from other great SEO’s out there.