Search
Clear search
Close search
Google apps
Main menu

Set up structured data for Merchant Center

This article outlines how to implement structured data markup for your product data. Before getting started, review About structured data markup for Merchant Center and verify your site meets the requirements. For general guidelines for structured data beyond your Merchant Center product data, visit Schema.org’s getting started guide.

Getting started

To add structured data markup to your website, you need to be able to access and edit your site’s HTML, or your shop system’s template configuration. Markup is an HTML tag annotation that lets search engine crawlers and bots know that there is product data on your site and helps the systems reliably understand the data. 

In order for Google’s crawler to match the structured data to your product data, one of the two following conditions must be satisfied:

  • There is a single offer on the landing page
  • If there are multiple offers on the whole page, each offer present on the page is annotated with a SKU or a GTIN and the respective offer in your product data on Shopping has the same SKU ('id' attribute) or GTIN ('gtin' attribute). This can be useful if you show multiple variants of the same product (e.g. different sizes or colors, or related products) on the same landing page.

If at least one of these conditions isn’t met, the products on your landing page won’t be able to match to your Google Shopping product data.

For more in-depth information about setting up structured data markups on your website, please visit schema.org’s getting started guide. The Schema.org section on machine-understandable versions of information provides help on understanding and clarifying your structured data. 

Add structured data markup

To add structured data markup to your site, you will either need to augment existing HTML on your site or create a new markup. In addition, you will need to determine if JSON-LD (recommended) or microdata best fits your needs.

Add new structured data markup (recommended)

We recommend you add new structured data markup with JSON-LD, separate from your HTML markup, especially if your product data contains variants. Added markup are distinct from any user-facing code, which makes it easier to maintain. Any structured data markup specifically designed for Google usage can be added without changing any of the visual elements of your site. Note that the code that generates your structured data needs to be kept in sync any changes to the user-facing elements on your site.

If you use an e-commerce platform on your site, you may need to make some changes to the platform template or code before adding your structured data. In addition, your site should be able to support JavaScript for template and page level applications.

Example

JSON-LD

<script type="application/ld+json">
{
  "@context": "http://schema.org/",
  "@type": "Product",
  "image": "http://example.com/test.jpg",  
  "name": "Example Test",
  "description": "This is just a boring example",
    "offers": {
    "@type": "Offer",
    "priceCurrency": "USD",
    "price": "199.99"
  }
}
</script>

Microdata


<span itemscope itemtype="http://schema.org/Product" class="microdata">
  <meta itemprop="image" content="test.png">
  <meta itemprop="name" content="Example Test">
  <meta itemprop="description" content="This is just a boring example">
  <span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
    <meta itemprop="price" content="119.99">
    <meta itemprop="priceCurrency" content="USD">
  </span>
</span>

Added structured data markups can appear anywhere in the HTML source. Any added markups must be present in the HTML returned from the web server, and can’t be generated after a page has been loaded using JavaScript.

Augment your existing content with structured data markup

If you chose to augment your HTML, you will need to have existing HTML tags that surround product data on your site. In some cases, it might be necessary to add new HTML tags. 

Usually, data augmentation can be done through HTML template edits and typically require minimal backend code changes. When you augment your data, information that is already on your site is reused for the structured data markup. 

Example

This example contains product data that has been augmented with structured data markup– the additions are highlighted.

<div class=”product-details” itemscope itemtype="http://schema.org/Product">
   <div class=”product-image”>
      <span class=”label”>Image:</span>
      <img itemprop="image" src=”test.png”>
   </div>
   <div class=”product-info”>
      <span class=”label”>Product Name:</span> 
      <span class=”info” itemprop="name">Example Test</span>
   </div>
   <div class=”product-info”>
      <span class=”label”>Description:</span> 
      <span class=”info” itemprop="description">This is just a boring example</span>
   </div>
   <div class=”product-info” itemprop="offers" itemscope    
                             itemtype="http://schema.org/Offer">
      <span class=”label”>Price:</span> 
      <meta itemprop="priceCurrency" content="USD"/>
      <span class=”price”>$<span itemprop="price">119.99</span></span>
   </div>
</div>

Products and Offers

Your landing pages should contain a Product object, which describes the product, and a nested Offer object in the offers field,  which describes how this product is sold. 

Note that the price must be specified with a period, instead of a comma, as a decimal separator. If you show the price in multiple currencies on the landing page, you can use multiple objects of type Offer. When you use multiple Offer objects, you’ll also need to use the priceCurrency attribute to specify currencies.

If a sales price is shown on the landing page and this price is what a user would actually pay at that point in time, make sure the sales price is provided in the structured data.

Important: Some product spec attributes are not supported by schema.org. Visit the supported structured data attributes page to learn more. Specifying price, priceCurrency, and availability is required for automatic item updates.

Test your markups

Test your Schema.org implementation with the Structured Data Testing Tool. Visit the Google Search Console Help Center to learn more about using the tool, debugging any issues, and interpreting your results in the tool.

Was this article helpful?
How can we improve it?