Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Googlebot and javascript-generated query strings

What can Googlebot read?

         

roodle

10:14 pm on Feb 8, 2006 (gmt 0)

10+ Year Member



Hi,

I'm curious to know how Googlebot handles on-page Javascript. By that I mean scripting not separated to to a .js file.

When people say the it can "read their links" in the script, do they mean links written explicitly or can Googlebot even handle functions that create links from arrays or similar?

I want to append querystrings to a set of links as the page loads. Nothing sneaky about it, it's purely to change the CSS on the page they link to, but it's a potential dupe content penalty if G can read the querystrings. The pages are all HTML, so it's all done with Javascript, such that any robot will see only the "base" link on the page, without the added querystring. I'm fairly sure this won't be picked up by G, but I'm wondering what others have experienced with this kind of thing.

tedster

12:08 am on Feb 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Googlebot will not execute javascript -- so if the query strings are generated through javascript, then normal crawling should not result in duplicate urls being indexed, as you assumed.

The issue you probably will run into, sooner or later, is that a link with the query string attached will get posted somewhere on the web and googlebot will follow it. Then you could have problems.

roodle

11:02 am on Feb 9, 2006 (gmt 0)

10+ Year Member



Tedster, that's a VERY good point. Hadn't thought of that. Hmmmm, may have to re-think the whole thing...

jd01

4:29 pm on Feb 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just a thought on this...

I remember reading somewhere the Mozilla GoogleBot may be reading/executing JavaScript. I cannot remember where I found the information though, so I have nothing to 'back-up' the claim. Just something I remember sticking with me, so it might be good to keep in mind when designing.

Justin

roodle

5:06 pm on Feb 9, 2006 (gmt 0)

10+ Year Member



Yeah that's probably why I was a bit nervous about this. I think I heard similar rumours. I've decided to completely ban the page these links point to, just in case G does end up working out how to build the querystrings.

Wizard

5:09 pm on Feb 9, 2006 (gmt 0)

10+ Year Member



The issue you probably will run into, sooner or later, is that a link with the query string attached will get posted somewhere on the web and googlebot will follow it.

Exactly, that's a point! I've solved this problem with very sophisticated way - I put the js generated query to hidden field in a form and submitted the form with POST method. So there are no URL with query anywhere.

So there is a form with hidden field named 'query', and js function which sets the value of this field and submits the form. This function is called from onclick event on links, so for the user it looks like there were normal links with no sophicticated stuff anywhere.

My site with this trick worked for over a year with no Google penalty, but now I'm going to put Adsense on it so I'm cleaning it up to avoid a risk that it could be deemed against Google guidelines :)

roodle

5:15 pm on Feb 9, 2006 (gmt 0)

10+ Year Member



Hey Wizard, that's a great solution. I forget that forms can be controlled like this. I'll try it out and see how it goes.

Why would it be against Google guidelines? I'm just trying to make the visitor experience more interesting by adjusting a page appearance according to link choice. Nothing "black hat" involved or whatever you want to call it.

Thanks