2

When deploying an Angular App with client side rendering only, do we need to take additional steps for Google to index the app, or is it automatic.

I did go to search console and register the site, but I'm curious as to whether I need to create an XML site map file, etc. or will Google automatically discover the routes?

Stephen Ostermiller
  • 99,822
  • 18
  • 143
  • 364
Ole
  • 225
  • 1
  • 7

1 Answers1

2

Googlebot now executes JavaScript and can automatically crawl and render pages on client side rendered sites. It sounds like you are already doing so, but to let the crawler do its job you need to:

  • Create a separate URL for each piece of content on your site. Google needs to be able to send visitors directly to the content they searched by directing them to a specific URL for that content. You can route all the URLs to the same handler code in Angular and have your code decide which content is appropriate based no the URL.
  • Render <a href=""> links on pages to link to other pages. You can intercept user clicks on those links and update just the content on the page that needs to change and update the URL using pushState. There is no need to make users completely load the whole page again when navigating. However, Google won't be able to find all the URLs on the site unless you use regular anchor links in your navigation elements.

It still might be a good idea to create an XML sitemap. Google is very slow about crawling and rendering client side generated sites. An XML sitemap could speed up the process of getting Google to discover and crawl your entire site. Without a sitemap it could take months, but with a sitemap it might take as little as a few weeks.

Just because you have an XML sitemap, you still need to link your URLs together with anchor links. Sitemaps help with URL discovery, but they don't help with URL reputation or rankings. For good SEO, a sitemap is not sufficient. You need to let Googlebot see the relationships between your pages so that it can calculate Pagerank. See The Sitemap Paradox.

Stephen Ostermiller
  • 99,822
  • 18
  • 143
  • 364