Skip to content
Log in

Product rich data snippet

On this page

StoreConnect generates product JSON-LD structured data using a built-in snippet. In v21, this snippet was renamed and extended with new fields for richer Google search results.

Template rename

The product JSON-LD snippet was renamed from:

snippets/products/product/json-ld.liquid

to:

snippets/products/product/rich_data_json.liquid

A backward-compatible shim means the old path (snippets/products/product/json-ld.liquid) continues to work without changes. You do not need to update any existing theme templates that reference the old snippet name.

:::note The shim provides backward compatibility for the old snippet name. Check with StoreConnect support for the timeline if you want to migrate to the new name. :::

What’s new in the rich data snippet

Multiple product images

Multiple product images are now included in the JSON-LD output, in line with Google’s recommendations. Previously, only the primary image was included.

```json

“image”: [ “https://example.com/image1.jpg”, “https://example.com/image2.jpg” ] ```

Price range for variant products

Variant products now output a price range using lowPrice and highPrice (schema.org Offer fields) when variants have different prices. When all variants share the same price, a single price field is used instead.

```json

{ “@type”: “Offer”, “lowPrice”: “29.99”, “highPrice”: “59.99”, “priceCurrency”: “USD” } ```

Variant relationship fields

The following fields are now included for variant products to help Google correctly understand product relationships:

Field Description
isVariantOf References the parent ProductGroup object
variesBy Array of DefinedTerm objects representing the attributes variants differ by. Variant types named Color (US or British spelling), Size, Material, or Pattern map to the canonical schema.org property (for example https://schema.org/color); any other variant type is output under its own name, so a “Bottle Size” axis stays "Bottle Size" rather than becoming an invented URL
productGroupID The Salesforce SFID of the parent product group. This is a stable internal identifier, not the product code

Availability and price

The snippet always outputs a price value (the sale price if set, otherwise the list price). Availability is always InStock unless Track Inventory is enabled on the product and the item is out of stock.

Additional fields

The following fields are included in the JSON-LD output when the relevant data is present on the product:

Field Condition Notes
brand Set on the product Output as a Brand object with name
gtin UPC is present Prefixed with "0" to produce a 13-digit GTIN-13 (for example, "0123456789012")
itemCondition Always https://schema.org/NewCondition or https://schema.org/UsedCondition

Schema types used

The snippet uses the following schema.org types:

Type Used for
ProductGroup The parent product (with variants)
Product An individual product or variant
Offer Price for a single product, variant, or price range across a product group
Brand Brand associated with the product
DefinedTerm Individual variant attributes within variesBy

Open Graph price meta tags

In addition to the JSON-LD block, StoreConnect adds Open Graph price meta tags to the <head> of each product page via snippets/meta_data.liquid:

```html

```

These tags are used by social platforms and some shopping integrations to read the product price directly from the page head, independently of the JSON-LD block. They reflect the same price used in the JSON-LD output (sale price if set, otherwise list price).

Optional partials

The snippet also renders a set of optional partials, each of which outputs nothing unless the product carries the relevant data. They live under snippets/products/product/rich_data/. The partials and the product.rich_data attributes they read require StoreConnect v22.0.6 or later.

Partial Schema.org output Rendered where
_warranty warranty (WarrantyPromise) Product level
_aggregate_rating aggregateRating (AggregateRating) Product level
_physical_attributes color, material, pattern, size (schema.org’s own Product properties) Product level
_shipping_details shippingDetails (OfferShippingDetails) Inside offers
_merchant_return_policy hasMerchantReturnPolicy (MerchantReturnPolicy) Inside offers

The product-level partials are assembled by snippets/products/product/_custom_product_data, and the offer-level ones by snippets/products/product/_product_data. Each partial ends its output with a trailing comma, which the assembling snippet strips, so a partial you write yourself should follow the same convention. _custom_product_data also has a commented custom-properties slot inside that same capture: add your own properties there, each ending in a comma, and the comma handling takes care of itself whether or not any automatic partial rendered.

Which fields feed each partial is covered in Structured data for product SEO. The partials read the product values from product.rich_data and the store defaults from the Store object: for example product.rich_data.color and current_store.return_policy_country. For a variant, the rating, shipping, and return policy partials fall back to the master’s values through product.master.rich_data; the warranty term never does. At the POS, these attributes hold values only for fields a POS layout brings down to the device.

Overriding one partial

To change one piece of the output without taking over the whole snippet, create a snippet template in your theme with the partial’s key, for example:

snippets/products/product/rich_data/_warranty

Your template replaces that partial only, and the rest of the structured data keeps receiving fixes and improvements with each release. To switch a partial off, override it with a template that contains only a Liquid comment, such as {% comment %}Disabled{% endcomment %}. A completely empty template falls back to the built-in partial, because Salesforce saves empty content as blank. To add your own schema.org properties, override snippets/products/product/_custom_product_data and fill in its custom-properties slot; keep additionalProperty for attributes the partials do not already emit as native properties.

Customizing the snippet

If you want to override the built-in JSON-LD output, create a snippet template in your theme with the key:

snippets/products/product/rich_data_json

Your custom snippet replaces the built-in output entirely. See Theme templates for how to create snippet templates.

Was this article helpful?

Was this article helpful?