Skip to content

Instantly share code, notes, and snippets.

@dannanelli
Last active October 8, 2024 01:46
Show Gist options
  • Save dannanelli/31891123cb201a1ba4e2052f125aec35 to your computer and use it in GitHub Desktop.
Save dannanelli/31891123cb201a1ba4e2052f125aec35 to your computer and use it in GitHub Desktop.
Review + AggregateRating Schema Example Template for Local SEO
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "LocalBusiness",
"name": "{{BUSINESS NAME}}",
"address": {
"@type": "PostalAddress",
"streetAddress": "{{STREET ADDRESS}}",
"addressLocality": "{{CITY}}",
"addressRegion": "{{STATE ABBREVIATION}}",
"postalCode": "{{ZIP CODE}}"
},
"telePhone": "{{PHONE NUMBER}}",
"geo": {
"@type": "GeoCoordinates",
"latitude": "{{LATITUDE}}",
"longitude": "{{LONGITUDE}}"
},
"url": "{{URL}}",
"logo": "{{LOGO URL}}",
"image": "{{IMAGE URL}}",
"priceRange": "{{$000 - $000}}",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "{{PUT A SINGLE DIGIT, WHAT THE AVERAGE RATING IS OVERALL (1-5)}}",
"ratingCount": "{{PUT A SINGLE DIGIT HERE, HOW MANY REVIEWS TOTAL ARE ON THE PAGE}}"
},
"review": [
{
"@type": "Review",
"author": "{{REVIEWER ONE NAME}}",
"datePublished": "{{YEAR-MONTH-DAY (xxxx-xx-xxxx)}}",
"reviewBody": "{{THE REVIEW CONTENT THAT REVIEWER ONE LEFT}}",
"reviewRating": {
"@type": "Rating",
"bestRating": "5",
"ratingValue": "{{PUT A SINGLE DIGIT, WHAT THE AVERAGE RATING IS (1-5)}}",
"worstRating": "1"
}
},
{
"@type": "Review",
"author": "{{REVIEWER TWO NAME}}",
"datePublished": "{{YEAR-MONTH-DAY (xxxx-xx-xxxx)}}",
"reviewBody": "{{THE REVIEW CONTENT THAT REVIEWER TWO LEFT}}",
"reviewRating": {
"@type": "Rating",
"bestRating": "5",
"ratingValue": "{{PUT A SINGLE DIGIT, WHAT THE AVERAGE RATING IS (1-5)}}",
"worstRating": "1"
}
}
]
}
</script>
@taha-112
Copy link

taha-112 commented Oct 6, 2024

hey can you guide me where to put this code

@dannanelli
Copy link
Author

dannanelli commented Oct 8, 2024

hey can you guide me where to put this code

@taha-112 Hi there! You can add schema code anywhere on a website; in the head, body or footer section. Search engines should have no problem reading the code.

I usually place it in the footer just to make sure the more important scripts like Google Analytics, Facebook Pixel, etc. can run with no issues in the head.

Reference: https://www.pigzilla.co/resources/where-do-i-put-json-ld-schema-scripts/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment