google / react-schemaorg

Type-checked Schema.org JSON-LD for React
Apache License 2.0
487 stars 19 forks source link

Schema not showing up in Structured Data Tool #7

Open axelferb opened 4 years ago

axelferb commented 4 years ago

Would there be a reason why, when putting my webpage in the STD (https://search.google.com/structured-data/testing-tool/u/0/) that it would not detect schema on the site when using this method in react? What it actually prints on the page looks fine (see below).

Would this still be fine for SEO even though it does not find it in the structured data tool?


<script type="application/ld+json">
{"@context":"https://schema.org","@type":"FinancialService","legalName":"Sambla AS","name":"Sambla","logo":"https://s3-eu-west-1.amazonaws.com/tpd/logos/55152ede0000ff00057e5303/0x0.png","image":"https://s3-eu-west-1.amazonaws.com/tpd/logos/55152ede0000ff00057e5303/0x0.png","telephone":"33222970","url":"https://www.sambla.no","email":"kundeservice@sambla.no","address":{"@type":"PostalAddress","streetAddress":"Arbins gate 2","addressLocality":"Oslo","postalCode":"0253"},"openingHours":["Mo,Tu,Th 09:00-20:30","We 13:00-20:30","Fr 09:00-17:00"],"priceRange":"10000 - 500000"}
</script>
Eyas commented 4 years ago

According to https://developers.google.com/search/docs/guides/intro-structured-data#structured-data-format it should be fine:

Also, Google can read JSON-LD data when it is dynamically injected into the page's contents, such as by JavaScript code or embedded widgets in your content management system.

Note that you can get the Structured Data Testing Tool to work just fine if your setup implements server-side rendering for react.

pavanshinde47 commented 4 years ago

If we don't use server side render... will it still work?

Eyas commented 4 years ago

Hi @pavanshinde47 see my above comment, this is specifically referring to the case where SSR is not enabled.