Dynamic Facebook Open Graph tags possible?

前端 未结 3 1106
北恋
北恋 2020-11-30 10:15

I\'m dynamically changing my and tags using jQuer

3条回答
  •  猫巷女王i
    2020-11-30 10:32

    Facebook does not parse JavaScript at all, you can´t use dynamic Open Graph tags. It does not really make sense to change them on the fly anyway.

    You can only change the OG tags dynamically on the server - obviously. For example: https://yourdomain.com/dynamicogtags.php?title=xxx&description=xxx

    
    

    Not sure if that´s what you want to do though, the URL looks pretty ugly that way. Rewrite would be nice, of course.

    You also may want to try something like prerender.io, but i am not sure if it will handle dynamic og tags.

提交回复
热议问题