googlebotgoogle-rich-snippetsrating-systemstructured-data

Adhering to Google's Structured Data Policy


Google's Product structured data reference recommends that aggregateRating be included. Common structured data errors document says:

The content referred to by the structured data is hidden from the user.

My question is how to verify that Google understands my UI? I'm using (5) svg star images to indicate the rating but there's 3 flavors of star, empty, half and full. Do I need to add a content="rating" or title="rating" attribute or …? I'd like to understand how does Google know I'm showing the 5 stars at all? I could be using .png files, or unicode ★.

  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "88",
    "bestRating": "100",
    "ratingCount": "20"
  }

Solution

  • Google doesn’t document how they verify if the visible content matches the structured data. As long as you don’t hide/omit the content, it should be fine.

    For this and all the other reasons, it would make sense to use accessible, semantic markup. If it’s accessible to users with disabilities, it’s typically also accessible to search engine bots.

    In the case of ratings, you could use the meter element:

    <meter min="0" max="5" value="3">★★★☆☆</meter>
    

    (As meter is probably not widely supported, you might want to consider using WAI-ARIA in addition: example with img elements and aria-labelledby.)