1

I've reviewed other questions and answers, but none fit my use case. Frankly, I'm not even sure if I'm asking the right question.

Here's my scenario: I work for an organization that is in the process of rewriting their website.

Let's assume we want to list a phonebook with some entries on a web page. There is a "phonebook component", designed in JavaScript and uses Handlebars as templates. Using grunt it is all uglified, concatenated, and minified in one file called phonebook.js. The way it works is this:

  1. Content editor opens up the page where s/he wants to insert the phonebook. All that person has to do is open the CMS HTML editor and insert this:

    <div class="phonebook-component"></div>

And that's it.

Now, what happens is that there's a global.js file that's loaded with every page. This script recognizes any class names that end with -component. When it recognizes the component, it makes a sync call to load the phonebook.js. The component is inserted, and it looks wonderful.

The problem is probably obvious. When you look up at the source code, there where the source code should be is just hat div tag I mentioned. This is what crawlers see too.

My question is: how can I make this crawlable? Is there any way? All my searches so far resulted in answers like "oh, this is how you make your AJAX SPAs crawlable".

2 Answers 2

2

oh, this is how you make your AJAX SPAs crawlable

That definitely should point you in the right direction. The search engines have said they have a standard for getting dynamic content indexed and it is very well documented. If you cannot make your application support it you need to do more work to add a search engine, and accessible, friendly version of your content.

FYI, Google does now process JavaScript so that should remedy this, at least fr them.

1
  • Thanks for the answer, it seems that generating HTML snapshots is the only solution to our problem. However, I don't see us doing that in the near future unfortunately. Aug 8, 2014 at 15:19
0

All you have to do is use Google's pushstate SEO meta tag for your Javascript served content .

Just add this meta tag in your site's <head> section

<meta name="fragment" content="!">

This is all new HTML5 improvement wherein your Javascript served content url's are returned with #! at the end of them to the crawlers. Basically Javascript served content is non crawlable but with this pushstate SEO tag the content shows up and is stored in a # based server with your site's content now visible to the crawler making it crawlable. Read more about it here.

7
  • I don't think you read my question. I'm not asking for Google to index multiple pages of my website. Aug 12, 2014 at 17:21
  • didn't you ask how to make your dynamically served content crawlable ? that's what I answered ! In case you just wish to serve few of the pages then you can use your robot.txt and pushstate seo to crawl the specific pages you want. BTW if page is not crawlable then it's obviously not indexed as well. Aug 12, 2014 at 19:35
  • I did, but your answer is not correct. You use the shebang only if you want your AJAX-accessible pages to be indexed. What I have here is something completely different; dynamically inserted, not through an AJAX call. And it has no multiple pages, just one page. Aug 13, 2014 at 14:17
  • Well it should work as long as it's JS, you can also have a look at prerender.io and Brombone who do the same stuff as the hashbang seo crawling. Aug 13, 2014 at 14:34
  • I'm sorry, but you're not understanding my question or my comments. Prerender.io and Brombone are both for SPAs - and that's NOT what I need. Aug 13, 2014 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.