Count vs. Votes Error for schema.org/AggregateRating

by Aaron Bradley on October 28, 2013

in Semantic Web, SEO

schema.org/AggregateRating and the Count vs. Votes Structured Data Testing Tool Error Message

schema.org has a mechanism for stating the average rating of an item based on multiple ratings or reviews: schema.org/AggregateRating. AggregateRating is the expected type for the property aggregateRating, which can be used on all CreativeWork, Organization, Place, Offer and Product types (you can't rate a Person, which is probably a good thing).

The phrase "multiple ratings or reviews" comes directly from schema.org, and noticably does not include the the word "vote" (which, in fact, at time as writing is not to be found anywhere on the schema.org site at all).

This is a problematic omission because one of the most common error messages generated by Google's Structured Data Testing Tool for (chiefly microdata) markup that uses AggregateRating concerns the use of "votes" rather than "count" (and "count" is not a valid property for any schema.org type either).

It is also problematic because this error sheds light on one of the most common reasons why review rich snippets do not appear in Google search results.

The "counts vs. votes" error in the Google Structured Data Testing Tool

Specifically, the Structured Data Testing Tool will often return this message when one tries to validate code containing AggregateRating:

Error: If count is specified in review aggregate, page should contain reviews. Otherwise you may want to use votes. More information about aggregate reviews.

If you were to run this code – HTML with schema.org/AggregateRating marked up using microdata – through the Structured Data Testing Tool that's exactly the error the Tool would return:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Proper use of reviewCount</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  </head>
  <body>
    <div itemscope itemtype="http://schema.org/Article">
      <h1 itemprop="name">Proper use of reviewCount</h1>
      <div itemprop="description">Don't use reviewCount when you should use ratingCount.</div>
      <div itemprop="articleBody">When marking up something with reviewCount make sure the something in question has reviews.  Otherwise, use ratingCount.</div>
      <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">Rated <span itemprop="ratingValue">4</span>/5 based on <span itemprop="reviewCount">2</span> reviews</div>
    </div>
  </body>
</html>

This despite the fact that star ratings appear in the Google search results preview for this code:

Google Structured Data Testing Tool rich snippet preview for schema.org/AggregateRating using the reviewCount property

What's going on?

Google guidelines for Review-aggregate and AggregateRating properties

First of all, Google is using the language of data-vocabulary.org in this error message, even though schema.org is used. The data-vocabulary.org item type equivalent to schema.org/AggregateRating is www.data-vocabulary.org/Review-aggregate/.

Review-aggregate employs properties that are different from – but equivalent to – AggregateRating properties.

The Review-aggregate property rating is equivalent to the AggregateRating property ratingValue.

The Review-aggregate property count is equivalent to the AggregateRating property reviewCount.

The Review-aggregate property votes is equivalent to the AggregateRating property ratingCount.

Armed with this nomenclature, we can then transform the Structured Data Testing Tool error message so it addresses schema.org/AggregateRating:

Error: If reviewCount is specified in AggregateRating, page should contain reviews. Otherwise you may want to use ratingCount.

And herein lies the problem with the example code snippet above. It employs the reviewCount property for AggregateRating, but the page itself doesn't list any reviews. That is, one if were to use the reviewCount property on a page, one would also expect to see one or more instances of the review property used for the parent item.

The Google Webmaster Tools rich snippet help page for the topic "rich snippets not appearing" has this to say about count vs. votes:

Your marked-up review uses count instead of votes. count specifies the total number of reviews for an item. votes specifies the number of people who provided a rating, with or without an accompanying review. A review can specify count or votes, or both. However, whenever you include count, the page must also contain markup for each reviewed item.

Again, this pertains to Review-aggregate. For AggregateRating this should read:

Your marked-up review uses reviewCount instead of ratingCount. reviewCount specifies the total number of reviews for an item. ratingCount specifies the number of people who provided a rating, with or without an accompanying review. A review can specify ratingCount or reviewCount, or both. However, whenever you include reviewCount, the page must also contain markup for each reviewed item.

Correct use of AggregateRating properties for items without reviews

The example page code displayed above uses reviewCount but contains no reviews. Simply replacing reviewCount with ratingCount in that code results in error-free valdiation in the Structured Data Testing Tool:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Proper use of reviewCount</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  </head>
  <body>
    <div itemscope itemtype="http://schema.org/Article">
      <h1 itemprop="name">Proper use of reviewCount</h1>
      <div itemprop="description">Don't use reviewCount when you should use ratingCount.</div>
      <div itemprop="articleBody">When marking up something with reviewCount make sure the something in question has reviews.  Otherwise, use ratingCount.</div>
      <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">Rated <span itemprop="ratingValue">4</span>/5 based on <span itemprop="ratingCount">2</span> reviews</div>
    </div>
  </body>
</html>

You'll also see that the preview rich snippet for this code now says "2 votes" rather than "2 reviews":

Google Structured Data Testing Tool rich snippet preview for schema.org/AggregateRating using the ratingCount property

In short, for items without reviews use ratingCount to express the total number of ratings, rather than reviewCount, which should only be used to express the total number of reviews.

Correct use of AggregateRating properties for items with reviews

For items with reviews, use reviewCount and markup individual reviews with the review property:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Proper use of reviewCount</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  </head>
  <body>
    <div itemscope itemtype="http://schema.org/Article">
      <h1 itemprop="name">Proper use of reviewCount</h1>
      <div itemprop="description">Don't use reviewCount when you should use ratingCount.</div>
      <div itemprop="articleBody">When marking up something with reviewCount make sure the something in question has reviews.  Otherwise, use ratingCount.</div>
      <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">Rated <span itemprop="ratingValue">4</span>/5 based on <span itemprop="reviewCount">2</span> reviews</div>
      <div itemprop="review" itemscope itemtype="http://schema.org/Review"><span itemprop="name">A great article</span> - by <span itemprop="author">John</span>, <meta itemprop="datePublished" content="2013-10-16">October 26, 2013
        <div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"><span itemprop="ratingValue">5</span>/5</div>
    <span itemprop="reviewBody">What I especially liked about this piece was that it contained only 17 words.</span>
      </div>
      <div itemprop="review" itemscope itemtype="http://schema.org/Review"><span itemprop="name">A bit brief</span> - by <span itemprop="author">Mary</span>, <meta itemprop="datePublished" content="2013-10-16">October 26, 2013
        <div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"><span itemprop="ratingValue">3</span>/5</div>
    <span itemprop="reviewBody">It was okay, but I was hoping for something a bit more comprehensive.</span>
      </div>
    </div>
  </body>
</html>

(If you run this code through the Structured Data Testing Tool, you may still see the "count vs. votes" error message. More on this below.)

This is a legitimate way of marking up an item using the reviewCount property for AggregateRating because there is a on-page review for each of the ratings for which the AggregateRating property ratingValue is an average.

What about off-page reviews? While I can't speak to whether or not the display of rich snippets would be supported by this code, it is at least technically legitimate (in my opinion) to use reviewCount where there is a click-path to individual reviews, even if they are not all present on the page where the item marked up with AggregateRating is declared.

<div itemscope itemtype="http://schema.org/Article">
	...
    <div itemprop="review" itemscope itemtype="http://schema.org/Review"><span itemprop="name">A great article...</span><span
 itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"><span itemprop="ratingValue">5</span>/5</span> <a href="review1.html" itemprop="url">Read full review</a></div>
</div>

However, how confident you feel using this code depends on how you interpret Google's guidelines that "the page must also contain markup for each reviewed item." Certainly the page contains review markup for each item reviewed, but not – on that same page – the actual review content. Caveat emptor.

Correct use of AggregateRating properties for items with a mix of reviews and ratings

Google has this to say about "votes":

votes is useful whenever users on a review site can rate an item without writing full corresponding reviews. Their vote contributes toward the average rating but not towards the number of reviews available.

Transposing this to AggregateRating one could say that the rating assigned by individual users contributes toward the the ratingValue of an AggregateRating, but not toward the number of reviews available as enumerated by reviewCount.

Accordingly (and in conjunction with the other Google guideline quoted above about a page containing "markup for each reviewed item") for pages that contain a mix of ratings with reviews, and ratings without reviews, I would recommend using only ratingCount and not reviewCount.

One could conceivably use both properties and adjust the counts accordingly, but that seems like rather a lot of bother to go to simply to delcare a correct count of reviews, and it increases the risk of errors appearing in the semantic markup of the page (and any such errors tend to hamper the display of rich snippets, regardless of the specific error).

In short, if your aim is the generation of review rich snippets, error on the side of caution by using ratingCount over reviewCount when in doubt.

What generates an AggregateRating "count vs votes" error message?

While the message under discussion here is prefaced "Error" it is sometimes generated when the code in question is error-free. This includes situations where there there are reviews on the page marked up using the review property, and the number of on-page reviews corresponds to value stated in reviewCount.

That is, indeed, the case with the code showing reviews above, where reviewCount has the value "2" and there are two reviews on the page. This is also the syntax employed by the examples currently displayed on schema.org/Review.

All of this to say that a Testing Tool "error" of this nature may best be thought of as an "informational message," and can certainly appear when one attempts to perfectly valid code.

The error is not even consistent for the same type of code. If one were to refashion the non-validating code above by simply having it reference a Product rather than an Article, but otherwise (after removing the Article-specific property articleBody) use exactly the same syntax, the "counts vs. votes" error message is not generated:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Acme Toaster Oven</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  </head>
  <body>
    <div itemscope itemtype="http://schema.org/Product">
      <h1 itemprop="name">Acme Toaster Oven</h1>
      <div itemprop="description">It toasts AND bakes.</div>
      <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">Rated <span itemprop="ratingValue">3</span>/5 based on <span itemprop="reviewCount">2</span> reviews</div>
      <div itemprop="review" itemscope itemtype="http://schema.org/Review"><span itemprop="name">A great toaster</span> - by <span itemprop="author">John</span>, <meta itemprop="datePublished" content="2013-10-16">October 26, 2013
        <div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"><span itemprop="ratingValue">5</span>/5</div>
    <span itemprop="reviewBody">First I had bread.  Then I had toast.  Magic!</span>
      </div>
      <div itemprop="review" itemscope itemtype="http://schema.org/Review"><span itemprop="name">A small oven</span> - by <span itemprop="author">Mary</span>, <meta itemprop="datePublished" content="2013-10-16">October 26, 2013
        <div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"><span itemprop="ratingValue">1</span>/5</div>
    <span itemprop="reviewBody">My 18-pound turkey wouldn't fit in this thing.</span>
      </div>
    </div>
  </body>
</html>

So beware of using reviewCount when you should be using ratingCount, but also be aware of the Structured Data Testing Tool notifying you of errors that don't exist. In this situation – as in others – if you're confident that your code is solid, go ahead and deploy it even if the Testing Tool complains. But pay close attention to those complaints when troubleshooting rich snippet display problems.

{ 26 comments… read them below or add one }

1 Rich Benci October 28, 2013 at 5:24 pm

Aaron – nicely researched article. Really shows the detail needed to properly implement Schema.org for optimal results … and why calling in an expert that is focused on this segment can pay dividends over doing it in house and potentially missing these nuances!

Reply

2 David Deering October 30, 2013 at 12:33 pm

Excellent article, Aaron, and thanks for clarifying the aggregate review and rating markup questions. We’ve seen many on Google’s forum who are using the incorrect property of reviewCount when they should have been using ratingCount. Unfortunately, this information isn’t very clear in Google’s rich snippet support articles, especially for those using schema.org. And thanks for the heads up about the error message in the testing tool. This will be a good page to send others to for more information regarding their aggregate rating and review markups. Thanks.

Reply

3 Aaron Bradley October 30, 2013 at 12:37 pm

Thanks @Rich and @David – glad you found the post useful.

Reply

4 Brett October 31, 2013 at 12:59 pm

Thanks for taking the time to dive deep into this. I have frankly been banging my head against the desk, wall, and in the door jam for some time trying to get his to work properly. I think this may just be the answer I was looking for, fingers crossed.

Reply

5 Aaron Bradley October 31, 2013 at 2:05 pm

Good to hear Brett – hope this puts you on the road to solving your problems.

Reply

6 Tony Hammarlund November 8, 2013 at 2:25 am

Great information, thank you. I am working with a beauty salon that want to display rating snippets.

My plan is to use the aggregate rating on the homepage with the count variable. Then I will display and rotate testimonials using a testimonial plugin.

Should I markup the testimonial custom post types (they have their own url) and do you think that this would be a good way to show aggregate ratings?

Reply

7 Aaron Bradley November 13, 2013 at 10:13 am

Glad you found the article useful Tony.

Regarding your question your homepage markup should be okay if there’s rating mechanism on that page, and if it’s not repeated elsewhere on the site.

There’s nothing wrong with your testimonial rotator on the homepage, as long as it doesn’t itself use structured data markup.

In regard to your testimonials I wouldn’t mark them up at all. A testimonial is not a review but a type of curated review: as such Google considers markup of testimonials spam. If you have a review (or rating and review) mechanism on site that shows all reviews, good or bad (or all ratings and all reviews, good or bad) then the individual reviews can be marked up and an aggregate review type used on an upper level page – but then these items are not testimonials per se, of course.

Google will use ratings and review data when these ratings and reviews provide their users with an unfiltered mechanism for assessing the quality of a product or service. A testimonial a hand-picked review and so does not meet this criteria.

Reply

8 nuno December 18, 2013 at 2:59 pm

Hi there congrats for your great post here, i would like if you can to help me out debugging some of my code, i cant seem to make it work righ, it always is giving an error and i cant identify what it is, can you please helpe me out on this?
those are the pages
this one
http://www.habifortaleza.com/index.php?action=searchresults&pclass%5B%5D=11
Thanks in advance and congrats for your AWSOME post.

Reply

9 Aaron Bradley January 16, 2014 at 8:54 am

Thanks Nuno.

Regarding your code, probably the best place to ask such questions is the Google Product Forum for rich snippets and structured data. You can also check out my Google+ Community.

Reply

10 Loui January 7, 2014 at 8:07 am

Hi Aaron, great article – I’ve been trying to get the snippets back for quite a while.
We made some changes to the page where we only displayed 10 reviews including mark-up on the product index page and the rest was on a pagination. e.g. /samsung-YD-television/2

Based on what I’m reading here I think we should skip the pagination and publish them all on the index page under scope=product. Am I right?

Reply

11 Aaron Bradley January 16, 2014 at 8:48 am

Thanks Loui. I’m not sure I fully understand your question, but I think I can cut to the quick.

Product category or index pages typically only use aggregateRating (and there’s no arbitrary limit to the number of aggregateRating blocks you mark up – that will be as many products that display a rating on that page), with Review used on the individual product pages referenced.

Reply

12 TimH January 29, 2014 at 8:23 am

Thank you so much for taking the time to write this down, without articles like this it was a nightmare and nearly impossible to implement many of the features that Schema.org promised.

Reply

13 Hessam February 3, 2014 at 10:41 pm

Thank you for the information. but there is something that’s happened to my sites voting stars and I don’t know why. I use Joomla 2.5 and Rich Snippets Vote for Joomla. it was OK for a month but after that Google never show stars for my pages, instead it shows the number of votes. eg: 5 out of 5 based on 45 votes.
the funny part is that Structured Data Testing Tool always show the stars for my pages and it is all nice!
extension: http://deconf.com/rich-snippets-vote-joomla/
my site: [redacted]

Reply

14 Aaron Bradley March 17, 2014 at 9:54 am

Thanks for your comment Hessam.

I don’t typically answer questions about specific deployments on this blog.

For structured data questions I suggest using the Google Webmaster Product Forum on Structured Data and Rich Snippets.

Reply

15 Stuart Young February 17, 2014 at 11:56 pm

Hi Aaron

Thanks very much for this excellent article!!
Been trying to fully get my head around this and your article has now helped so much and makes logical sense. Am just in the process of implementing Schema.org data into my web site.

Do you have any suggestions for a quality “reviews” WordPress plug-in for enabling viewers to leave their “vote” and/or review?

Thanks again!
Cheers
Stuart

Reply

16 Aaron Bradley February 18, 2014 at 2:49 pm

Thanks Stuart – glad you found the article helpful.

I’m afraid I haven’t employed a WordPress plugin for reviews before, so I can’t make any personal recommendations.

WP Customer Reviews seems to meet your needs (while it doesn’t use schema.org, it does employ the well-supported hReview and hReview-aggregate microformats).

All In One Schema.org Rich Snippets might also fit the bill, although I’m not sure if this supports user input of reviews: taking it for a test drive will answer that question soon enough.

You might also try posing the question over on Semantic Search Marketing.
.

Reply

17 Dennis April 2, 2014 at 6:20 am

Thanks you for this clarification. I’ve been wondering for quite a while.

Reply

18 Joshua Jacobson April 4, 2014 at 5:35 am

Aaron,
The code was removed from my previous post. Please see a detailed writeup of my question where I build on the great work you’ve done here.

Thanks,
Joshua

Reply

19 Aaron Bradley May 8, 2014 at 4:40 pm

Thanks Joshua – I finally replied at the WordPress URL above.

Reply

20 Jacek April 25, 2014 at 12:07 am

how to make the display a price?

[URL redacted]

Reply

21 Aaron Bradley May 8, 2014 at 3:53 pm

Hi Jacek. I generally don’t have the time to answer questions related to specific markup or search result display issues here. For the information you’re after you may want to go to the Google Webmaster Forum on Structured Data and Rich Snippets.

Reply

22 Abram May 10, 2014 at 11:19 am

With regard to this comment:

“…you can’t rate a Person, which is probably a good thing”

You may review certain types of people, but only when they inheret from Organization. Example: http://schema.org/Physician

Reply

23 roberta May 10, 2014 at 3:27 pm

Ciao, vorrei chiedere un consiglio…ho da tanto tempo il plugin GD Star Rating sul mio sito, ma non ho mai visto nei risultati di ricerca un mio articolo con le stelline…oggi sono andata a fare un test per i dati strutturali, quindi ho inserito l’url di un mio articolo e nel test ho ottenuto un risultato con 5 stelle ma sotto Google dice questo : “Errore: Either “count” or “votes” field needs to be present”
Non saprei proprio come risolvere il problema. Haron Bradley puoi aiutarmi? Grazie!

Reply

24 Aaron Bradley May 14, 2014 at 1:45 pm

Mi dispiace, non lo so italiano. :(

Reply

25 Ismail Yusof October 6, 2014 at 4:30 am

Hi Aaron,

You’ve done it again, Aaron, I mean, making my life with “structured data markup” a lot easier. I have been getting error messages every time I run my markup in Google’s Structured Data Testing Tool and I have been searching all over the place in the internet to find an explanation for the errors. After reading this post and followed your guidelines, I no longer receive any error messages.

Thanks Aaron, you have been a lot of help, may God bless you for sharing this information.

Reply

26 Mike Keating December 10, 2014 at 8:55 pm

Thank you so much for this information. I was trying to find an answer and you were the only detailed explanation on how to solve this error. Google just never wants to make it easy for us to do what they want ;)

Reply

Leave a Comment

Previous post:

Next post: