Angular Meta tags for social media not crawl

Viewed 625

I am developing angular 9 application. I have added dynamic meta tags. Tags are changing page wise dynamically but when we see page source code on browser it's showing index.html page default meta tags. I am changing title, description, keywords & canonical tags.

enter image description here

enter image description here

You can see on both pages we got diffent meta tags as per page but when we look for Page Source (CTRL+ u) on browser it is showing index.html default meta tags.

You can see on both pages we got diffent meta tags as per page but when we look for Page Source (CTRL+ u) on browser it is showing index.html default meta tags.

1 Answers

You are changing meta tags page wise (dynamically) but this changes are only seen inside an actual browser, because this only happens after the pages are rendered inside the browser.

the problem is that the bots that most of social media networks (such as Twitter or Facebook & etc.) use to fetch the meta tags can Not render Java-script properly so that only thing they can get is the index.html

if you'd like to get meta tags dynamically for each page you need to use SSR (Server Side Rendering) technologies such as Angular Universal as @GaurangDhorda said in comments.

Here is a reference to Angular Universal Official Page

Related