Product properties: GoodRelations and hProduct

A Product listing has a number of properties, which you can mark up using microdata, microformats, or RDFa. The main Products article provides examples of Product listings marked up using the Google Product vocabulary and the microdata syntax. However, you can also mark up Products using hProduct (microformats) or GoodRelations. For GoodRelations, use the Offering class to specify the item for sale and its attributes.

The table below lists provides hProduct and GoodRelations equivalents for the Google Product vocabulary. (For convenience, it also lists the Merchant Center equivalents, where available.) Note that not all properties have hProduct or GoodRelations equivalents. For example, while Product listings recognized by Google include Product details (details about the product itself, such as its name, brand, and model) plus either Offer or Offer-aggregate details, GoodRelations and hProduct do not follow the same structure.

To use GoodRelations markup, be sure to specify the appropriate namespaces at the beginning of each item or set of items, as follows:

  • xmlns:gr="http://purl.org/goodrelations/v1#": Specifies the GoodRelations namespace.
  • xmlns:foaf="http://xmlns.com/foaf/0.1/": FOAF. Required to identify product images.
  • xmlns:v="http://rdf.data-vocabulary.org/#": Indicates that your content uses RDFa syntax.

For more detailed information, see the following:

Supported Product properties

Product

Product hProduct GoodRelations Merchant Center feed
name fn gr:name title
image photo foaf:depiction image_link
brand brand gr:hasManufacturer (for the brand link); and gr:BusinessEntity for the manufacturer name. brand
description description gr:description description
category category product_type
review review Review information is enclosed in the v:hasReview tag. Use the child v:Review-aggregate tag to specify the review formats.
identifier gr:hasStockKeepingUnit
gr:hasEAN_UCC-13
gr:hasMPN
gr:hasGTN

Offer

Product hProduct GoodRelations Merchant Center feed
price price Price information is enclosed in the gr:hasPriceSpecification tag. Use the content attribute of the child gr:hasCurrencyValue to specify the actual price to Google (use only a decimal point as a separator). price
priceRangeLow Price information is enclosed in the gr:hasPriceSpecification tag. Use the content attribute of the child gr:hasMinCurrencyValue to specify the lowest price of the available range (use only a decimal point as a separator).
priceRangeHigh Price information is enclosed in the gr:hasPriceSpecification tag. Use the content attribute of the child gr:hasMaxCurrencyValue to specify the highest price of the available range (use only a decimal point as a separator).
priceValidUntil gr:validThrough expiration_date
currency Price information is enclosed in the gr:hasPriceSpecification tag. Use the child gr:hasCurrency to specify the actual currency.
seller gr:BusinessEntity
condition gr:condition condition
availability Inventory level is enclosed in the gr:hasInventoryLevel tag. Use the child tag gr:QuantitativeValue to specify the quantity in stock. For example, an item is in stock if the value of the content attribute of the enclosed tag gr:hasMinValue is greater than 0. See the example below for more details. availability
offerURL url foaf:page link
identifier gr:hasStockKeepingUnit
gr:hasEAN_UCC-13
gr:hasMPN
gr:hasGTN

Offer-aggregate

Product hProduct GoodRelations Merchant Center feed
priceRangeLow Price information is enclosed in the gr:hasPriceSpecification tag. Use the content attribute of the child gr:hasMinCurrencyValue to specify the lowest price of the available range.
priceRangeHigh Price information is enclosed in the gr:hasPriceSpecification tag. Use the content attribute of the child gr:hasMaxCurrencyValue to specify the highest price of the available range.
currency Price information is enclosed in the gr:hasPriceSpecification tag. Use the child gr:hasCurrency to specify the actual currency.
seller gr:BusinessEntity
condition gr:condition condition
availability Inventory level is enclosed in the gr:hasInventoryLevel tag. Use the child tag gr:QuantitativeValue to specify the quantity in stock. For example, an item is in stock if the value of the content attribute of the enclosed tag gr:hasMinValue is greater than 0. See the example below for more details. availability
offerURL url foaf:page link
identifier gr:hasStockKeepingUnit
gr:hasEAN_UCC-13
gr:hasMPN
gr:hasGTN

Examples

Product listing (single product, single seller)

GoodRelations

This example shows how to mark up content using the GoodRelations vocabulary with the RDFa markup syntax.

The following HTML code describes a product listing for the ACME Executive Anvil.

ACME Executive Anvil
<img src="anvil_executive.jpg" />
Average rating: 4.4, based on 89 reviews

Regular price: $179.99
Sale price: $119.99 (Sale ends 5 November!)

Condition: Previously owned

Sleeker than ACME's Classic Anvil, the Executive Anvil is perfect for 
the business traveler looking for something to drop from a height.

Category: Anvils

In stock! Order now!

Use the Offering class in GoodRelations to specify the item for sale and its attributes. Here is the same content marked up using GoodRelations:

<div 
   xmlns:foaf="http://xmlns.com/foaf/0.1/"
   xmlns:gr="http://purl.org/goodrelations/v1#"
   xmlns:v="http://rdf.data-vocabulary.org/#"
     typeof="gr:Offering">
   
  <span property="gr:name">ACME Executive Anvil</span>
  <span rel="foaf:depiction">
    <img src="anvil_executive.jpg" />
  </span>
  <span rel="v:hasReview">
    <span typeof="v:Review-aggregate">
      Average rating: <span property="v:rating">4.4</span> stars 
        based on <span property="v:count">89</span> reviews
    </span>
  </span>
  <span rel="gr:hasPriceSpecification">
    <span typeof="gr:UnitPriceSpecification">
    Regular price: $179.99
    Sale price: $<span property="gr:hasCurrencyValue" content="119.99">119.99</span> (Sale 
      ends <span property="gr:validThrough" content="2010-5-11T23:59:59">
      5 November!</span>)
      <span property="gr:hasCurrency" content="USD" ></span>
    </span>
  </span>
    
  <span property="gr:condition" content="used">Previously owned</span>

  <span property="gr:description">Sleeker than ACME's Classic Anvil, the 
    Executive Anvil is perfect for the business traveler looking for something to drop 
    from a height.</span>
  Category: Anvils
  <span rel="gr:hasInventoryLevel">
    <span typeof="gr:QuantitativeValue">
      <span property="gr:hasMinValue" content="1">In stock!</span> Order now!
    </span>
  </span>

</div>

Here's how this sample works.

  • The sample begins with a set of namespace declarations using xmlns. This indicates the namespaces where the vocabularies (a list of entities and their components) are specified. This example specifies the following namespaces (use the strings exactly as shown):
    • foaf: "Friend of a Friend"—used to identify images related to the product.
    • gr: GoodRelations.
    • v: data-vocabulary.org—used to specify Review information
  • Also in the first div, typeof="gr:Offering" indicates that the content included in the div is a product listing.
  • Each property of the Offering (such as the product for sale and the price) is labeled using property. In this example, GoodRelations properties are prefixed with gr:.
  • The Offering contains several nested items—for example, a nested Review-aggregate, identified by typeof="v:Review-aggregate".

Microformats

Note: Google currently supports the hProduct microformat only. We do not currently support the hListing format for product rich snippets. Because you cannot use microformats to indicate condition or availability (for example, "used" or "out-of-stock"), we recommend using hProduct only for new, in-stock products only.

The following HTML code describes a product listing for an ACME-brand anvil.

ACME Executive Anvil
<img src="anvil_executive.jpg" />
Average rating: 4.4, based on 89 reviews

Regular price: $179.99
Sale price: $119.99 (Sale ends 5 November!)

Sleeker than ACME's Classic Anvil, the Executive Anvil is perfect for 
the business traveler looking for something to drop from a height.

Category: Anvils

Here is the same content, marked up with the hProduct microformat.

<div class="hproduct">

  <span class="brand">ACME</span> <span class="fn">Executive Anvil</span>
  <img class="photo" src="anvil_executive.jpg" />
  <span class="review hreview-aggregate">
    Average rating: <span class="rating">4.4</span>, based on <span class="count">89
      </span> reviews
  </span>

  Regular price: $179.99
  Sale: $<span class="price">119.99</span> (Sale ends 5 November!)

  <span class="description">Sleeker than ACME's Classic Anvil, the Executive Anvil is 
    perfect for the business traveler looking for something to drop from a height.</span>

  Category: <span class="category">
    <span class="value-title" title="Hardware > Tools > Anvils">Anvils</span>
  </span> 
</div>

Here's how this sample works.

  • In the first line, class="hproduct" indicates that the HTML enclosed in the <div> summarizes a Product. The structured information is conveyed by the class attribute (such as class="fn" and class="rating", and the values (such as "Executive Anvil"). You can change the tags such as span and div to suit your formatting needs.
  • The product contains a nested Review-aggregate, identified by class="review hreview-aggregate".
  • The example also demonstrates the use of the value-title property to give search engines information while displaying different content to human users. In this case, class="value-title" tells search engines to use the content of the title attribute (instead of the content of the tag itself) to identify the Product category.
Shopping aggregator page

The following HTML code describes a listing for a product, the ACME Executive Anvil, that is available from several sellers at a range of tempting prices.

<h1>ACME Executive Anvil</h1>
<img src="anvil_executive.jpg" />
4.0/5 based on 80 reviews
from $119.99 to $180

GoodRelations

Here's the same code, marked up with the GoodRelations properties. (This use case is not yet supported for microformats.)

<div 
   xmlns:foaf="http://xmlns.com/foaf/0.1/"
   xmlns:gr="http://purl.org/goodrelations/v1#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:v="http://rdf.data-vocabulary.org/#"
   typeof="gr:Offering">

  <h1 property="gr:name">ACME Executive Anvil</h1>
  <span rel="foaf:depiction">
    <img src="anvil_executive.jpg" />
  </span>
  <span rel="v:hasReview">
    <span typeof="v:Review-aggregate">
      <span property="v:rating">4.0</span>/5 
        based on <span property="v:count">80</span> reviews
    </span>
  </span>

  <span rel="gr:hasPriceSpecification">
    <span typeof="gr:UnitPriceSpecification">
      from $<span property="gr:hasMinCurrencyValue">119.99</span>
      to $<span property="gr:hasMaxCurrencyValue">180</span>
      <span property="gr:hasCurrency" content="USD"></span>
    </span>
  </span>
</div>

Here's how this sample works.

  • The sample begins with a set of namespace declarations using xmlns. This indicates the namespaces where the vocabularies (a list of entities and their components) are specified. This example specifies the following namespaces (use strings exactly as they appear):
    • foaf: "Friend of a Friend"—used to identify images related to the product.
    • gr: GoodRelations.
    • v: data-vocabulary.org—used to specify Review information
  • Also in the first div, typeof="gr:Offering" indicates that the content included in the div is a product offering.
  • Each property of the Offering (such as the Product and the price) is labeled using property. In this example, GoodRelations properties are prefixed with gr:.
  • The Offering specifies the lowest (gr:hasMinCurrencyValue and highest (gr:has MaxCurrencyValue) rates available from all sellers.