6

How can I tell if a google bot is reading my javascript generated content?

I have an AJAX script that generates some text dynamically on a page... this content does not change by user, but simply by date/time.

I am not sure how I can tell if google sees it.

cherouvim
  • 31,725
  • 15
  • 104
  • 153
fighella
  • 580
  • 5
  • 16

10 Answers10

6

Search engine bots don't have javascript, so they won't see any content that was dynamically added to your page via AJAX, etc. In your browser options, turn off Javascript and reload your website. All that they'll see is the content and the links there.

The solution: on your page, in the plain HTML place a link to a page which shows the rest of your content (the stuff that you would load via AJAX), then have Javascript replace that link with the content. The search engine bots will see the link and follow it, indexing all your content. Just make sure that on these lo-fi pages, you provide links back to the regular page, since that's what Google will link to.

nickf
  • 537,072
  • 198
  • 649
  • 721
  • That is strange. Who uses document.write anyway, though? – nickf Aug 20 '09 at 07:35
  • But - if you link to something that has content for purely this reason, then it may be indexed by Google and depending on what it is - may look strange if someone clicks directly on it from a search results page (I hope that makes sense). – alex Aug 20 '09 at 09:35
  • 1
    yeah I know what you mean - that's what I was trying to say in that last sentence. You could always put a Javascript redirect on those pages. ;) – nickf Aug 20 '09 at 12:31
3

Download Lynx and access your site. if you can see your content, google can too!

Here's the link Lynx Viewer

Moak
  • 12,596
  • 27
  • 111
  • 166
2

I don't think it will. If you want it to be always read by Google, try generating some default text server side by the date time, and overwriting that with js.

alex
  • 479,566
  • 201
  • 878
  • 984
2

It doesn't. As far as I know, Google does not yet support JavaScript (or, in fact, any form of dynamic content).

Sasha Chedygov
  • 127,549
  • 26
  • 102
  • 115
2

Important content, whether it be needed for SEO, accessibility or both, should be available to users (or in this case, bots) without JS. Although, recently I read this little blog post which says that Google bot has JS.

dylanfm
  • 6,292
  • 5
  • 28
  • 29
  • Read the first comment on that blog post: that is much nearer the mark than the suggestion that Googlebot executes scripts in the general case. – NickFitz Aug 20 '09 at 09:35
2

I would run it through Google's Webmaster tools site, which has a function to view your page as Googlebot. You may be able to determine it's visibility through there.

https://www.google.com/webmasters/tools/home?hl=en

tekknolagi
  • 10,663
  • 24
  • 75
  • 119
Jeff Garon
  • 31
  • 2
2

If you're considering developing a full-blown AJAX website, Google says there's a way of making AJAX applications crawlable.

Short answer: there's an agreement between crawler and server on URIs.

Brian Clozel
  • 56,583
  • 15
  • 167
  • 176
1

JavaScript generated content is not indexed by search engines. See this question for more info.

Community
  • 1
  • 1
Dmytrii Nagirniak
  • 23,696
  • 13
  • 75
  • 130
0

No I dont think they read dynamic content generated using javascript. What you see as view source of a page is generally what a google bot will read. Or you can say what you see in Lynx.

moha297
  • 1,902
  • 1
  • 16
  • 16
0

Perform a fetch and render within Google's Webmaster tools. Google will tell you in there. Alternatively, use their page speed test tool. Again, it will tell you if your JS is accessible or not.

The easiest way to know, is to simply copy a chunk of text output within the JS within the browser and perform a search in Google.