Angular 4 and SEO
Asked Answered
E

1

7

I have a simple Angular 4 project served by Express. When I tried to fetch my site using Googlebot, it just showed a blank page (the innerHTML of AppRoot). I thought Google claimed its bots support Angular 4 / JS websites?

If this is still issue, is server side rendering using Angular Universal really the best solution? Like I have to set up another server that serves the server-side rendered app in addition to the main server that serves the normal client-side rendered app? And if it is, how do I tell googlebot to go to the port for the server-side rendered app and normal http traffic to go to the port for the client-side rendered app? Aren't crawlers http traffic?

Expedition answered 7/6, 2017 at 0:34 Comment(3)
This question appears to be off-topic because it is not within the bounds of discussion as described in the help center.Bethesda
Server side rendering using Angular Universal should solve the problem as far as SEO is concerned. Both googlebot and normal traffic should hit the same server. There should not be separate arrangement for googlebots IMO. Here is a good read: coursetro.com/posts/code/68/…Picket
@Deepakswain yes, new guy, it is. It's a combination of a recommendation question ("is server side rendering using Angular Universal really the best solution?") and about how Googlebot works, which is not on topic here. Go read the seo tag.Bethesda
S
0

The issue is not Angular4 specific. Any data generated dynamically by javascript will show first as blank, and then load its content. I assume you are looking at google page speed Insights.

To see what google see:

  1. comment out your external css
  2. comment out your external js

This will be google initial view. After that google will fetch the external files, run your javascript and render the page. Google page speed will penalize you for any changed pixels above the fold before and after fetching the external assets.

Angular Universal (or any server side rendering as this is not an angular issue) will solve that problem.

Hope that helps.

Salinas answered 15/8, 2017 at 6:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.