google Structured Data Testing Tool error
Ad
<script type="application/ld+json">
{"@context" : "http://schema.org",
"@type" : "LocalBusiness",
"name" : "website.com",
"description": "About. asdadsad ",
"image" : "http://website.com/image.png",
"telephone" : "123456789",
"email" : "[email protected]",
"address" : {
"@type" : "PostalAddress",
"streetAddress" : "N1 Big street",
"addressLocality" : "city",
"addressCountry" : "Country"
},
"url" : "http://somesite.com/",
"sameAs" : ["http://www.facebook.com/",
"http://twitter.com",
"http://plus.google.com/"],
"aggregateRating" : {
"@type" : "AggregateRating",
"ratingValue" : "4",
"bestRating" : "5",
"worstRating" : "0"
},
</script>
This is my created code for web schema, but when I try to test on Google Structured Data Testing Tool it returns the error :
JSON-LD: There was an error parsing your JSON-LD.
How do I fix this? Which error do I have in this code ?
Ad
Answer
Ad
Your JSON is missing a closing bracket }
at the end.
Your last }
is closing the aggregateRating
propriety and you have none to close your object.
Just add a }
and it works.
PS : your AggregateRating
object is missing a ratingCount
or reviewCount
.
Here is an fixed version of your code:
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "LocalBusiness",
"name" : "website.com",
"description": "About. asdadsad ",
"image" : "http://website.com/image.png",
"telephone" : "123456789",
"email" : "[email protected]",
"address" : {
"@type" : "PostalAddress",
"streetAddress" : "N1 Big street",
"addressLocality" : "city",
"addressCountry" : "Country"
},
"url" : "http://somesite.com/",
"sameAs" : [
"http://www.facebook.com/",
"http://twitter.com",
"http://plus.google.com/"
],
"aggregateRating" : {
"@type" : "AggregateRating",
"ratingValue" : 4,
"bestRating" : 5,
"worstRating" : 0,
"ratingCount" : 12
}
}
</script>
Ad
source: stackoverflow.com
Related Questions
Ad
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → Passing a JS var from AJAX response to Twig
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → DropzoneJS & Laravel - Output form validation errors
- → Import statement and Babel
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM
Ad