review count and rating using an image - schema.org
Asked Answered
A

1

7

I need some help getting some rich snippets to my site

I inserted the review microdata following the instructions given on schema.org here http://schema.org/docs/gs.html#advanced_missing using the star-image for rating and the text for review count, but testing it with the test tool it showed nothing. Example page where we use the microdata for the reviews.

and here is what I used

<div itemprop="reviews" itemscope itemtype="http://schema.org/AggregateRating">
  <A HREF="javascript:an();"><img src="/images/stars/4.5.gif" border=0></a>
  <meta itemprop="ratingValue" content="4.5" /> 
  <meta itemprop="bestRating" content="5" />
  <BR>
  <span class="bottomnavfooter">
    <A HREF="javascript:an();">Read (<span itemprop="ratingCount">70</span>) Reviews</A 
  </span>
</div>

I then created a static test page and made some change using instructions Google provided here http://www.google.com/support/webmasters/bin/answer.py?answer=172705 (which is different from what I found on schema.org!!) but still the test returned only product name not the price or the reviews.

Here is my test page - Can you please see where I'm going wrong

Thanks much!!

Anaphylaxis answered 21/11, 2011 at 17:13 Comment(3)
If @Lawrence answered your question, please check it and give him credit.Prosperity
@Prosperity sorry, wasn't aware.. i'm not very familiar with this, will look around and give him what he deserves, he was absolutely awesome!!Anaphylaxis
I see the green check by his answer, @Joel, so I think you've got it figured out. Welcome to the Stack Overflow community!Prosperity
M
9

The above code snippet will fail because it has an itemprop for aggregateRating, but isn't enclosed in an itemscope. It also doesn't help that your final anchor close tag is missing a >, but I guess that was just an accident when you were copying the code into SO.

The other problem mainly brought about because the example on the schema.org site is wrong (I have filed a bug report on this). They mention itemprop="reviews" instead of itemprop="aggregateRating". The code should look more like the following:

<div itemscope itemtype="http://schema.org/Offer">
  <span itemprop="name">Ray-Ban 2132 New Wayfarer Sunglasses</span>
  <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
    <a href="javascript:an();"><img src="/images/stars/4.5.gif" border=0></a>
    <meta itemprop="ratingValue" content="4.5" /> 
    <meta itemprop="bestRating" content="5" /> 
    <br />
    <span class="bottomnavfooter">
      <a href="javascript:an();">Read (<span itemprop="ratingCount">70</span>) Reviews</a>
     </span>
  </div>
</div>
Magically answered 22/11, 2011 at 7:15 Comment(3)
Thanks @Lawrence I followed you exactly and it worked! problem is; does it need to be in this order? on our site the product name is not right above the reviews, how do I go about it, (otherwise I think that on the actual page we use the correct code, it was only the test page where I messed it up) Thanks again for your time!Anaphylaxis
@Anaphylaxis If I understand you properly, you can put as much html as you like between the div for itemtype=http://schema.org/Offer and the div for http://aggregateRating, they don't have to have a direct parent-child relationship.Magically
Thanks so much @Lawrence it works fine now, not sure I'll have anything out of it, there is no guarantee from Google's side, but I did my part...Anaphylaxis

© 2022 - 2024 — McMap. All rights reserved.