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 that your site meets the requirements.
- For general guidelines for structured data beyond your Merchant Center product data, visit schema.org's Getting started guide. We also recommend using Search Console to troubleshoot structured data related issues, and to measure your site's search traffic and performance.
- Additional guidance can be found in the Product structured data article, specifically the sections on merchant listings.
On this page
- Getting started
- Add structured data markup
- Products and offers
- Test your markups
- Required structured data for product pages with in-store availability
- Required structured data for click and collect offers
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's 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, the following conditions must be satisfied:
- There's 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
[id]
attribute) or GTIN (GTIN[gtin]
attribute). This can be useful if you show multiple variants of the same product (for example, different sizes or colours, or related products) on the same landing page. - Structured data markup must be present in the HTML returned from the web server. The structured data markup can't be generated using JavaScript after the page has loaded.
- Your landing page content, including pricing, must not dynamically change based on user information such as IP address or browser type.
- Structured data must match the values that are shown to the user. Providing incorrect data on your product landing pages is a violation of our web developer guidelines.
If at least one of these conditions isn't met, the products on your landing page won't match your product data.
The schema.org section on machine-understandable versions of information provides help on understanding and clarifying your structured data.
Add structured data markup
JSON-LD markup
To add structured data markup to your site, we recommend that you add this as JSON-LD to your HTML markup. Refer to the Introduction to structured data markup in Google Search for more information.
JSON-LD markup is distinct from any user-facing code, which makes it easier to maintain. Any structured data markup specifically designed for Google use can be added without changing any of the visual elements of 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
{
"@context": "https://schema.org/",
"@type": "Product",
"sku": "trinket-12345",
"image": "https://example.com/trinket.jpg",
"name": "Nice trinket",
"description": "Trinket with clean lines",
"gtin": "12345678901234",
"brand": {
"@type": "Brand",
"name": "MyBrand"
},
"offers": {
"@type": "Offer",
"url": "http://example.com/trinket_offer",
"itemCondition": "https://schema.org/NewCondition",
"availability": "https://schema.org/InStock",
"price": "39.99",
"priceCurrency": "USD"
}
Added structured data markup can appear anywhere in the HTML source, but we recommend putting product structured data in the initial HTML for best results.
Products and offers
Your landing pages should contain both:
- A Product object, which describes the product
- A nested Offer object in the offers field, which describes how this product is sold
Note that the price must be specified with a full point as a decimal separator, instead of a comma. 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 time, make sure that the sales price is provided in the structured data.
Important: Some product spec attributes are not supported by schema.org. Specifying the following schema.org values is required for automatic item updates: price
, priceCurrency
, availability
and condition
. Learn more about merchant listing (product, offer) structured data on Google Search Central.
Test your markups
Test your schema.org implementation with Search Console or the Rich Results Tool. Visit the Rich Results Test or the Google Search Console Help Centre to learn more about using the tool, debugging any issues and interpreting your results in the tool.
Required structured data for product pages with in-store availability
If you have opted into local inventory ads with product pages with in-store availability, you can add the additional structured data markup from the table below to your nested offers, to show in which physical shops the product is sold:
Note: Schema.org markup can be used on web pages written in any language. The markup, like HTML, is in English. Schema.org values are case sensitive.
Schema.org value | Product or inventory feed specification value | Value type |
Product > offers > availableAtOrFrom > branchCode | Shop code [store code] |
A unique alphanumeric identifier for each local shop. You must use the same shop codes that you provided in your Business Profiles. |
Required structured data for click and collect offers
If you have opted into local inventory ads with product pages with in-store availability and the option to pick up later or pick up today, you can add the additional structured data markup from the table below to your nested offers, to show in which physical shops the product is available for collection:
Note: Schema.org markup can be used on web pages written in any language. The markup, like HTML, is in English. Schema.org values are case sensitive.
Schema.org property | Product or inventory feed specification value | Value type |
Product > offers > availableDeliveryMethod | – | The OnSitePickup [OnSitePickup] schema.org value indicates that the product is available for click & collect. |
Product > offers > potentialAction | collection method [pickup method] |
The BuyAction schema.org value indicates that the product can be purchased online for click & collect. The ReserveAction schema.org value indicates that the product can be reserved online for click & collect. |
Product > offers > deliveryLeadTime | collection SLA [pickup sla] |
The delivery lead time should only be a 1 or a 0. This is used to indicate the estimated number of days until the item is available for collection, as follows: 0 = Same day 1 = Next day |
Learn more about structured data for Merchant Center.