I am wondering where should i put the schema markup code? Should i put it in the <head>
tag or in the <body>
tag?
This is a sample code from Google and they haved added it in the tag but I read somewhere that it is completely fine to put it either <head>
or <body>
tag.
https://developers.google.com/search/docs/appearance/structured-data/review-snippet
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Review",
"itemReviewed": {
"@type": "Restaurant",
"image": "https://www.example.com/seafood-restaurant.jpg",
"name": "Legal Seafood",
"servesCuisine": "Seafood",
"priceRange": "$$$",
"telephone": "1234567",
"address" :{
"@type": "PostalAddress",
"streetAddress": "123 William St",
"addressLocality": "New York",
"addressRegion": "NY",
"postalCode": "10038",
"addressCountry": "US"
}
},
"reviewRating": {
"@type": "Rating",
"ratingValue": "4"
},
"name": "A good seafood place.",
"author": {
"@type": "Person",
"name": "Bob Smith"
},
"publisher": {
"@type": "Organization",
"name": "Washington Times"
}
}
</script>