Hello I am interested in adding the following JSON-LD structured data to my Gatsby Site. I have tagged React in this as the response in Gatsby is typically very low. What I would like to do is follow along the example here
https://developers.google.com/search/docs/guides/intro-structured-data
How do I add structured data to a Gatsby or a React site?
I am looking for both a static solution (i.e. for Contact Page) and a dynamic solution (i.e. for a Recipe Page ) to auto fill the values
2
Answers
The best practice for creating and adding SEO is described in this official Gatsby documentation.
You add an SEO component with React helmet:
On the bottom you can find some example links. The documentation describes both solutions for static and dynamic meta tags.
In your SEO component itself create two objects
First,
Second,
Then finally add this inside Helmet tag
If you want to test your structured data, once your site is deployed goto
https://search.google.com/structured-data/testing-tool/u/0/ and put your website url in there, it will give you an insight on your structured data.