I want to add google structured data for my gatsby
website. But I can't find any detailed information on that.
I tried to use google tag manager but it doesn't seems to work.
I am seeking for a way to add google structure data on my website. I want an article schema for all my pages except the home page. And FAQ schema for home page.
Add SEO to Page As a bare minimum, you should add a title and description. Example with just title and description: import React from 'react'; import { GatsbySeo } from 'gatsby-plugin-next-seo'; export default () => ( <> <GatsbySeo title='Simple Usage Example' description='A short description goes here.
Gatsby automatically provides drop-in support for server rendering of metadata and it'll be added to the static HTML pages that Gatsby produces. This helps your site rank and perform better in search engines. By the end of this guide you'll have a SEO component that you can use in your pages to define metadata.
Monitoring overall structured data performance If you'd like to have an overall idea of all the errors for a specific structured data feature in your site, you can navigate to the Enhancements menu in the left sidebar and click a feature. You'll find a summary of all errors and warnings, as well as the valid items.
Looks like what you want is to combine the concepts of the SEO component, as described here: https://www.gatsbyjs.org/docs/add-seo-component/ and react-helmet's support for the script tag: https://github.com/nfl/react-helmet#reference-guide
The prismic starter by LekoArts does this. Here's the file for reference: https://github.com/LeKoArts/gatsby-starter-prismic/blob/master/src/components/SEO/SEO.jsx
Now to make them different for the home page vs your article pages, you'll likely need to amend the component to accept whatever data you want to pass down from the article.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With