Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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>
like image 493
Piece of Code Avatar asked Oct 27 '16 07:10

Piece of Code


2 Answers

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>
like image 60
sidarcy Avatar answered Nov 10 '22 02:11

sidarcy


This error started appearing somewhere in the month before your post. Since the error disappears when the "contactPoint" is left out, even though it doesn't contain an URL, this is most likely a bug in the validation tool.

I came across the same problem and asked about it on the support forum.

like image 41
DieterDP Avatar answered Nov 10 '22 02:11

DieterDP