Posts

Showing posts from 2018

Server Side Rendering with meta tags in Angular [ANGULAR 2/4/5] [LARAVEL (PHP)]

Issues When a post having open graph tags is shared on social media, they use crawlers that fetch relevant metadata. The issue with AngularJS and dynamic metatags or you have a "single page app" with push state URLs (React, Angular, Ember, Vue, Preact etc...) When you share your link relevant site bot make fetch meta data from that, but problem is most social sites don't execute javascript.In fact, they use the plain HTML as they see it. Solution When Facebook/Twitter does not want to evaluate Javascript, we have to serve it something it can digest. Therefore, I built a conditional redirect for these crawlers to a small script that emits the information. Idea (problem) URL(https://frontend/user/id)==>Angular(javascript) API call==>backend(server method)==>Run script==>return response Step 1 :bot hit url call frontend(angular or etc)page Step 2 :angular page call API or backend route Step 3 :backend return respons than bot get response or met...