How to make facebook crawler loads page dynamic title / description?

875 Views Asked by At

My little application is written in reactjs, on a page it will update title / description based on the real object that user selected like this photo. The new title and description are display correctly but when sharing on fb, the values are not loaded correctly (the value is from old html templated) - go to facebook and paste the url or use fb debugger the values are from static html page.

Have anyone had this issue and have "fixed" it ?

Thanks for any recommendation !

2

There are 2 best solutions below

0
andyrandy On

Facebook ignores JavaScript, so dynamic OG tags are not possible. You can solve this with Server Side Rendering or https://prerender.io/, for example.

0
Anuj Goyal On

You can pass as parameter in url (abc.com?title=awesome&desc=flower), and in og tags use that parameter to make dynamic.