guest9119
guest9119

Reputation: 211

Google Crawler for Single Page Application

I've a website with a menù on the left (about 5/6 entries) and a center region div in the rest of the page. The center region is populated using an ajax call. When user click on a new menu entry the content of the div will be removed and replaced with a new one obtained through ajax.

Now the problem is google indexing. I've some questions about this:

  1. If going to the main page trigger automatically a first ajax call (the first menu entry), is google able to read the content of the first page?

  2. If the answer to the first question is yes, i can be able to differentiate pages using the hash notation (ex. mysite.com#page/1 ) and give user the chance to access directly another menu entry using the corresponding hash. After that is possible to build a sitemap that includes one link for each hash entry? In that case google is able to read all the content of my website? if yes, could you give me an example of the sitemap?

  3. Finally, if the answer of the first question is no, what is the best way for indexing a single page application like this?

Basically i've really less content, but for me is very important the ux that a single page app can expose to user.

Last question: i've also the mobile version build with the "page" notation of jQuery mobile. Is possible to make google indexing?

Thanks in advance, any help will be appreciated.

Bye!

Upvotes: 1

Views: 4111

Answers (1)

War10ck
War10ck

Reputation: 12508

This question is probably a better fit for webmasters.stackexchange.com but I'll give it a go here anyway.

This was Google's previous recommendation for indexing single page applications's using a headless browser to take a "snapshot" of the ajax enabled HTML that is then sent to the bot. However, this was deprecated in October 2015 because Google Bot is now able to read and interpret JavaScript and CSS files provided it's not blocked in a robots.txt file. See this blog post for more details.

I think this should answer all three questions. As long as you stick to a normal already defined single page application structure such as using the hash #, hashbang #! or history.pushState() then you should be fine to define pages however you want and create an associated sitemap using your defined link structure.

Upvotes: 4

Related Questions