2

I have an angular app and am now thinking about fine tuning for SEO purposes.

Having had a look at a number of documents and tutorials I am pretty confused! I understand that in the past you would have to use a prerendering service. But then Google updated its bots to crawl JavaScript better. I can't see much about what is the best practice now for improving crawlers and indexing given this?

My current set up is that I have a site map and have transformed my URLs to #! from !. and also, I haven't yet enabled html5 mode.

Josip Ivic
  • 3,639
  • 9
  • 39
  • 57
Jack Power
  • 303
  • 1
  • 3
  • 14
  • what is the usefulness of #! ? – Mr Smith Aug 27 '15 at 15:42
  • My understanding is that it helps Google to know it is a JavaScript heavy page. They go into a little bit of detail about it here https://scotch.io/tutorials/angularjs-seo-with-prerender-io – Jack Power Aug 27 '15 at 15:46
  • Beware, there's a lot of information out there on how to get your javascript heavy sites crawled that is out of date. HTML5 mode enabled + a thorough sitemap can result in an SPA website being properly crawled, but there's a lot of gotchas as well, such as ui-sref on non-anchor tags resulting in links (possibly) not being crawled. – Kevin B Aug 27 '15 at 16:08
  • https://pbs.twimg.com/media/CFn6qEFWAAAzlFY.png –  Aug 27 '15 at 17:19
  • Hi Kevin. Great - that makes things a bit easier! There is just so much advice out there (as with all things SEO) that is either incorrect or outdated. All I want to do is to make sure there aren't any big errors! @Will, I laughed at your post - but think that it may be a bit extreme :) – Jack Power Aug 27 '15 at 18:39

1 Answers1

0

Just follow this three parameters, and all will be fine.

1) Follow the advice contained in this post on generating snapshots of your pages using Phantom.js and a custom cache layer. Make sure that each page has a friendly URL and serve a list of all of your URLs in a sitemap.xml file. Instead of serving the snapshots when the ?_escaped_fragment_= parameter is included in the requested URL, serve the snapshot when the page is requested by a known search engine user agent like GoogleBot.

2) Use a service such as Prerender.io

3) Allow your AngularJS to be rendered by Google without prerendering and, see what happens. Do use the HTML5 history API to update the visible URL in the browser without using a #! if you can possibly avoid it. Most developers agree that #! are not ideal and they certainly add complexity to the SEO of a site.

Josip Ivic
  • 3,639
  • 9
  • 39
  • 57