You are here:
Structured Data for Commerce Product Meta Tags
Create rich and engaging search results by using structured data from your store to dynamically update a page’s meta tags. For example, you can map product attributes like color or size to meta tags using expressions.
Required Editions
| View supported editions. |
Which Salesforce Commerce Product Do I Have?
| Field | expression | example value |
|---|---|---|
| Product Category Name |
{!Record.ProductCategory.Name}
|
“Clothing” |
| Product Attributes (must use variant products) |
{!Record.ProductAttributes.<custom field you created for variant
products>}
|
Dependent on the field created for variant products. For example, “Medium” or “Red” for size or color. |
| Price Currency |
{!Record.Offers.Currency}
|
"USD" |
| Price |
{!Record.Offers.Price}
|
"32.99" |
| Breadcrumb |
{!Record.BreadcrumbList}
|
[{"@type":"ListItem","item":"https://domain.com/storeName/category/merchandise/0ZGxx000000004rGAA","position":1,"name":"Merchandise"},{"@type":"ListItem","item":"https://domain.com/storeName/category/merchandise/clothing/0ZGxx000000006TGAQ","position":2,"name":"Clothing"}]
|
| Default Product Image |
{!Record.ProductMedia.DefaultImage}
|
"https://domain.com/image1.jpg" |
| Product Detail Images |
{!Record.ProductMedia.ProductDetailImages}
|
["https://domain.com/image1.jpg","https://domain.com/image2.jpg"] |
To use product attribute values in meta tags, first set up variant products. For more information, see Product Variations and Attributes. To use pricing information, make sure that your products belong to a standard price book. To use breadcrumbs, make sure the primary category of your product is navigable. For more information, see Choose Product Categories to Use in Breadcrumbs.
Use a script with these expressions to add structured data to a custom head tag on a Product Detail Page. For more information, see Configure Page Meta Tags for Commerce.
<script type="application/ld+json">
[{
"@context": "https://schema.org/",
"@type": "Product",
"name": "{!Record.Name}",
"category": "{!Record.ProductCategory.Name}",
"color": "{!Record.ProductAttributes.ProductColor__c}",
"size": "{!Record.ProductAttributes.ProductSize__c}",
"material": "{!Record.ProductAttributes.ProductMaterial__c}",
"offers": {
"@type": "Offer",
"priceCurrency": "{!Record.Offers.Currency}",
"price": "{!Record.Offers.Price}"
},
"image": "{!Record.ProductMedia.DefaultImage}"
},
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": "{!Record.BreadcrumbList}"
}]
</script>
Validate Structured Data
To validate structured data in an environment, inspect the HTML source code for a page and
navigate to the <script> tags containing the JSON-LD data as shown in
the example.
Perform a manual snapshot refresh before validating structured data in an org, see Provide Search Engines with Fresh Content Snapshots.

