Adding Schema.org / Rich Snippets to your products

Follow

Overview


Structured data tags are used by search engines to index product pages and display search results. Some Google services require pages to use schema.org tags. This article provides code snippets examples of how you might use schema.org tags on your product pages. 

For more information on schema.org structured data tags, see: schema.org/docs/documents.html

 

The Tags


Below is a compilation of the required (and commonly used) schema.org tags for products. These can be added and/or edited in Themes > Edit Theme > Pages > Product Details > HTML Editor.  The "..." indicate that your theme might have additional code between the tags shown. The item properties must be spelled exactly and use the correct character casing. For example in the tag <meta itemprop="name" content="##PRODUCTNAME##"> , itemprop must equal exactly "name".

  • This would not be valid: itemprop="Name"
  • This would not be valid: itemprop="itemname"
  • This would not be valid: itemprop="name". 

In general, meta tags are interchangeable with other HTML tags. For example:

  • This is valid: <meta itemprop="name" content="##PRODUCTNAME##">
  • This is valid: <div itemprop="name">##PRODUCTNAME##</div>
  • This is valid: <div itemprop="name" style="dispaly:none;">##PRODUCTNAME##</div>

  <!-- BEGIN Schema.org Product Rich Snippet Markup -->
  <div itemscope="" itemtype="http://schema.org/Product">
    <meta itemprop="category" content="##CATNAME##">
    <meta itemprop="mpn" content="##MFGPARTNUMBER##">
    <meta itemprop="name" content="##PRODUCTNAME##">
    ...
    <meta itemprop="image" content="https://yourstore.com/##ITEMPHOTOURL##">
    ...
    <div class="tab-pane fade in pad-20 no-pad-lr active" id="desc1" itemprop="description">$$TAB1$$</div>
    ...
    

    <!-- review -->
    <div itemprop="review" itemscope="" itemtype="http://schema.org/Review">
       ...
       <span itemprop="author">$$AUTHORNAME$$</span>
       ...
       <span itemprop="description">$$REVIEWBODY$$</span>
    </div>
    ...
    

    <!-- aggregateRating -->
    ##IF[ReviewCount!=0]##  <!-- display if review count isn't 0 -->
    <div itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating">
        <meta itemprop="ratingValue" content="##AVERAGERATING##">
        <meta itemprop="bestRating" content="5">
        <meta itemprop="worstRating" content="1">
        <meta itemprop="reviewCount" content="##REVIEWCOUNT##">
    </div>
    ##ENDIF##
    ...
    
    <!-- manufacturer and sku... -->
    <div itemprop="manufacturer" content="##MFGNAME##">$$MFGNAME$$</div>
    <div class="ItemNR">Item # <span itemprop="sku">$$ITEMNR$$</span></div>
    ...

<!-- offers --> <div id="dvProductPricing" class="ProductDetailsPricing" itemprop="offers" itemscope="" itemtype="http://schema.org/Offer"> <meta itemprop="seller" content="##STORENAME##"> <meta itemprop="itemCondition" itemtype="http://schema.org/OfferItemCondition" content="http://schema.org/NewCondition"> <link itemprop="availability" href="http://schema.org/InStock"> <meta itemprop="priceCurrency" content="USD"> <meta itemprop="price" content="##RAWPRICE##"> ... </div> <!-- END Schema.org Product Structured Data Markup -->

 

Troubleshooting


Google may notify you through your Google Merchant Center that your products have missing or broken tags. The first step to fixing the tags is to use Google Structured Data Testing Tool. The tool asks for a product page URL and then runs the test. Errors and/or warnings will be displayed and marked:

2017-07-26_14-57-04.png

 

The above screenshot shows a warning on the product "price" property: "Price: $10 is not a valid price specification". If we go to http://schema.org/price, we can see an example of how the tag should be structured: 

 

2017-07-26_15-01-55.png

 

schema.org/price also provides some nice usage guidelines: 

Usage guidelines:

  • Use the priceCurrency property (with ISO 4217 codes e.g. "USD") instead of including ambiguous symbols such as '$' in the value.
  • Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator.
  • Note that both RDFa and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting.
  • Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similiar Unicode symbols.

 As always, we recommend backing up your theme or code before making any changes. 

Getting Help


There's many resources online on editing, maintaining, and adding scheme.org tags to websites. Here's some we recommend: 

  • https://support.google.com/merchants/answer/7353427?hl=en
  • https://support.google.com/merchants/answer/6069143?hl=en
  • https://moz.com/learn/seo/schema-structured-data
  • http://schema.org/docs/gs.html

Our free technical support can help you navigate the admin to find the appropriate edit page. If you're not comfortable making changes yourself, the account management team can provide you with a quote on the work. If you have any additional questions, don't hesitate to submit a support ticket or give us a call.

 

Have more questions? Submit a request

Comments

  • Avatar
    Brian Gluck

    Great document for the DIYer, and even better that it is automatically included for the new responsive themes you release!