kodyl / react-document-meta

HTML meta tags for React-based apps. Works for both client- and server-side rendering, and has a strict but flexible API.
MIT License
320 stars 23 forks source link

Facebook crawler #37

Open metju90 opened 7 years ago

metju90 commented 7 years ago

Hi

After several hours of testing and experimenting, I had found out that Facebook crawler is missing open graph meta tags generated by react-document-meta.

The following meta tags were created by react-document-meta in the head but were never read by Facebook crawler image

until I had to hardcode the OG meta tags like the following:

image

The only difference I see between the two meta tags is the 'rdm' data attribute

danieljuhl commented 7 years ago

@metju90 the Facebook crawler can only "read" the tags if you are using react-document-meta in your server-side rendering. Otherwise the tags won't be added until the JS is executed.

Have you followed the SSR example? Please provide some code samples. We have several production sites, which Facebook is crawler without problems.

windinging commented 5 years ago

@metju90 have u found the problem yet. it seems that i have the same problem when i used it in client-side.the facebook crawler don't use the added meta tag, it uses the old meta tags.

danieljuhl commented 5 years ago

@windinging we have several sites in production, and hasn't been able to reproduce. Can you provide an URL where this should be a problem? The above screenshots does not verify, that the meta tags was generated during SSR - it actually looks to be from the client side generated HTML, which obviously would not work, as Facebook does a simple HTML fetch (and no JS execution). Have you use the SSR example?