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!!

Lawrence Woodman
  • 1,424
  • 9
  • 13
Joel
  • 467
  • 1
  • 6
  • 18
  • 1
    If @Lawrence answered your question, please check it and give him credit. – james.garriss Dec 19 '11 at 17:41
  • @james.garriss sorry, wasn't aware.. i'm not very familiar with this, will look around and give him what he deserves, he was absolutely awesome!! – Joel Dec 20 '11 at 18:11
  • I see the green check by his answer, @Joel, so I think you've got it figured out. Welcome to the Stack Overflow community! – james.garriss Dec 21 '11 at 15:52

1 Answers1

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>
Lawrence Woodman
  • 1,424
  • 9
  • 13
  • 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! – Joel Nov 22 '11 at 15:01
  • @Joel 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. – Lawrence Woodman Nov 22 '11 at 15:50
  • 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... – Joel Nov 23 '11 at 21:08