Google SDTT error: "All values provided for http://www.example.com/ must have the same domain."

Piece of Code picture Piece of Code · Oct 27, 2016 · Viewed 9.9k times · Source

When I copy/paste JSON-LD example from Google Documentation (code-snippet below) I get an error in the Structured Data Testing Tool:

http://www.your-company-site.com (All values provided for http://www.example.com/ must have the same domain.)

Why is Google's own documentation example giving an error?

Code snippet from Google’s documentation:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Organization",
  "url": "http://www.your-company-site.com",
  "contactPoint": [{
    "@type": "ContactPoint",
    "telephone": "+1-401-555-1212",
    "contactType": "customer service"
  }]
}
</script>

Answer

sidarcy picture sidarcy · Jan 3, 2017

It appears the testing tool assumes example.com as its domain.

When testing if you can update your url to "www.example.com" it will validate successfully.

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Organization",
  "url": "http://www.example.com/",
  "contactPoint": [{
    "@type": "ContactPoint",
    "telephone": "+1-401-555-1212",
    "contactType": "customer service"
  }]
}
</script>