问题
I want to add Corporate Contacts in Google Search. I test the following code in Google's Structured Data Testing Tool, but it threw this error:
https://coda-resume.herokuapp.com/
(All values provided forhttp://www.example.com/
must have the same domain.)
Here is the JSON-LD:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"url": "https://coda-resume.herokuapp.com/",
"logo": "http://www.example.com/logo.png",
"contactPoint": [{
"@type": "ContactPoint",
"telephone": "+1-401-555-1212",
"contactType": "customer service"
}]
}
</script>
(I put this in the head
element.)
回答1:
This is likely a bug in Google’s Structured Data Testing Tool.
(When removing the contactPoint
property, the tool no longer reports an error, although the snippet still contains the same url
value.)
See DieterDP’s answer in a related question.
回答2:
I get this error:
<script type="application/ld+json">
{{
"@context": "http://schema.org",
"@type": "Organization",
"Url": "http://www.your-company-site.com",
"Logo": "http://www.example.com/logo.png",
"ContactPoint": [{
"@type": "ContactPoint",
"Telephone": "+ 1-401-555-1212",
"ContactType": "customer service"
}]
}
</script>
If you use https://www.thegioididong.com
for example:
<script type="application/ld+json">
{{
"@context": "http://schema.org",
"@type": "Organization",
"Url": "https://www.thegioididong.com/",
"Logo": "https://www.thegioididong.com/logo.png",
"ContactPoint": [{
"@type": "ContactPoint",
"Telephone": "+ 1-401-555-1212",
"ContactType": "customer service"
}]
}
</script>
You will get the following errors in the testing tool:
https://www.thegioididong.com/ (All values provided for https://search.google.com/structured-data/testing-tool/ must have the same domain.)
This happens because you the code is not on the web before checking.
Upload the code to the website, then check back in the testing tool. Now you won't get any more errors.
回答3:
i was thinking it's a bug and trying to found solution, but this is not a bug at least we can't aspect from Google this kind of small bug. Basically error is saying (All values provided for https://search.google.com/structured-data/testing-tool/ must have the same domain.) so it's mean Google Tester aspecting URL value is "https://search.google.com/structured-data/testing-tool/" so if you try this code with your information just keep remain URL value as it is, you will find it working and 0 error.
<script type='application/ld+json'> {"@context": "http://www.schema.org","@type": "Organization","name": "Your Company Name","url": "https://search.google.com/structured-data/testing-tool/","logo": "https://cdn.com/cms/assets/companylogo.svg","contactPoint": {"@type": "ContactPoint","telephone": "+90 00 000 00","contactType": "Customer Service"}}</script>
回答4:
Ignore error at the Development level, On Live Production it works fine, may be because, Google’s Structured Data Testing Tool consider Live Domain
回答5:
I've just realized that the error comes from the @context
property.
Try changing "http://schema.org" to your site's URL, Google stops showing that error, and yes! That's WRONG! What characterizes a bug in the Google Tool!
来源:https://stackoverflow.com/questions/40399076/google-structured-data-error-all-values-provided-for-http-www-example-com-m