Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Indexing angularjs app - Googlebot-simulation vs site:domain

I have recently created a webpage using Angularjs and I'm currently trying to get it indexed by Google using pushstate.

I've done quite abit of research and found out that I can use Googlebot-simulater in Google Webmaster tools to simulate a Google-visit on my site, and see how the bots see my webpage vs what the users see.

Here the result looks good, Google sees exactly the same stuff as my users, and all the pages/subpages get the status of either partially or fully.

Another way I've been informed about, this morning, to see what Google sees on my website is by googling site:domainname. Here comes a list of all the pages/subpages Google has cached and by clicking on the different links, you get a view where the respective page is showed.

Here is were I get a little concerned that I missed something, because regardless of the partially/fully status my pages get from the Goolgebot-simulation, when I look at my pages (using the second method), the pages are all blank.

It is my first time indexing webpages, and I have tried for days, but without any luck. Is there somebody that can tell what I'm doind wrong/missin, or at least point in the right direction? Or should I just be a little more patient?

like image 395
Backer Avatar asked Sep 18 '15 11:09

Backer


1 Answers

The answer from Johannes Ferner is not correct. It used to be, and Google has been really slow to update their docs, but they have officially announced that they do handle AJAX pages without the need for HTML snapshots as long as you are using pushstates. Bing has followed suite and also handle pushstates.

As an example of this, search for site:yoamoseguros.com and check the cached results there. The page is built in Angular and is loaded completely using AJAX and pushstates, and it shows and indexes fine.

And ignore the broken pages, I did a failed deploy a few days ago with a completely broken redirect that messed everything up, and Google had time to index the broken pages before I had a chance to remove them. The one time they indexed my stuff fast... :/


So if you are using pushstates (html5mode on) and your pages are not shown properly by Google then there is something else going on. Check your robots.txt, are you blocking Google from reading static content like js-files or images? It needs access to files like that to be able to index the page properly.

Also, make sure your fragments are just "#" and not "#!". In the latter case Google will assume that you want to use html snapshots and will try to find them, and might fail. So if you want to use the simpler pushstate version, make sure you are not using "#!".


As a final note, Facebook does NOT support pushstates. So Facebook will still need snapshots (or just hard-coded og-tags in index.html depending on what kind of content you have).

like image 156
Erik Honn Avatar answered Oct 05 '22 02:10

Erik Honn