Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can LinkedIn crawler read SPA pages?

I am using PhantomJS along with the Angular-seo package.

I managed to configure it to work with Facebook open-graph, but it seems that LinkedIn doesn't support the _escaped_fragment_ format, and just ignores the route after the hasbang requesting the index.html page of the application instead of myapp.com/?_escaped_fragment_=client_side_path.

What can I do in order to resolve it?.

like image 962
Oleg Belousov Avatar asked Oct 20 '13 09:10

Oleg Belousov


2 Answers

Unfortunately the only way to resolve this is to check the user agent of the bot and send them the static version. According to this, the user agent of the LinkedIn bot is this:

LinkedInBot/1.0 (compatible; Mozilla/5.0; Jakarta Commons-HttpClient/3.1 +http://www.linkedin.com)
like image 144
Alexander Hill Avatar answered Sep 18 '22 16:09

Alexander Hill


LinkedIn is not rendering JS and will only process the html static content of your SPA as of today.

As your application is highly dynamic, you could redirect LinkedIn crawler requests to an endpoint that will dynamically generate the required HTML for the LinkedIn crawler (e.g quick win: by using a CDN with a rules engine and serverless functions)

If you don’t need to feed the crawler with real-time information, you may consider using:

  • a prerendering service (e.g. prerender.io)
  • a static site generator to create prerendered pages of your SPA on your own
like image 26
memcpy Avatar answered Sep 18 '22 16:09

memcpy