0

I am working on a large site and want to implement JSON-LD. The site has a large social media following and a lot of artist profiles and articles.

This is what I currently have, (the following code is from Google's guidelines)

Front page

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Organization",
  "name": "Organization name",
  "url": "http://www.your-site.com",
  "sameAs": [
    "http://www.facebook.com/your-profile",
    "http://instagram.com/yourProfile",
    "http://www.linkedin.com/in/yourprofile",
    "http://plus.google.com/your_profile"
  ]
}
</script>

Content pages

<script type='application/ld+json'> 
{
 "@context": "http://www.schema.org",
 "@type": "WebSite",
 "name": "About us",
 "url": "http://www.your-site.com/about-us"
}
</script>

Profile pages of each artist:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "NewsArticle",
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://google.com/article"
  },
  "headline": "Article headline",
  "image": [
    "https://example.com/photos/1x1/photo.jpg",
    "https://example.com/photos/4x3/photo.jpg",
    "https://example.com/photos/16x9/photo.jpg"
   ],
  "datePublished": "2015-02-05T08:00:00+08:00",
  "dateModified": "2015-02-05T09:20:00+08:00",
  "author": {
    "@type": "Person",
    "name": "John Doe"
  },
   "publisher": {
    "@type": "Organization",
    "name": "Google",
    "logo": {
      "@type": "ImageObject",
      "url": "https://google.com/logo.jpg"
    }
  },
  "description": "A most wonderful article"
}
</script>

Do I add one script tag per page or do I add all JSON-LD under one script tag? On the front page I have the "Organization" tag and show the social media links, do I add this on all pages?

waka
  • 3,362
  • 9
  • 35
  • 54
Hanna Stone
  • 193
  • 2
  • 11

1 Answers1

1

You may have multiple script JSON-LD data blocks on a page, but using one script element makes it easier to connect the structured data entities: you can nest entities instead of having to reference their URIs.

What to connect? Your NewsArticle can

  • provide the WebPage¹ entity as value for the mainEntityOfPage property, and
  • provide the Organization entity as value for the publisher property.

This is only one possibility. Another one: You could provide the WebPage entity as top-level item and provide the NewsArticle entity as value for the mainEntity property.

If you have to duplicate data (for example, because the Organization is author and publisher, or because it’s the publisher of both, the WebPage and the NewsArticle), you can mix nesting and referencing. Give each entity an @id and wherever you provide this entity as value, also provide its @id.


¹ You are using WebSite, but you probably mean WebPage. Also note that the @context should be http://schema.org, not http://www.schema.org.

unor
  • 92,415
  • 26
  • 211
  • 360
  • Thank you unor, it's a bit clearer now. I copied the code from Google, so not sure why the @context is wrong... – Hanna Stone Oct 02 '17 at 12:13