JSON Microdata

Basic SEO | Shopper Experience - Last updated Mar 20, 2020

Adding structured data to your website helps search engines display more detailed search results which encourage more click-thru's.

Below are instructions on how you can add JSON microdata to your custom product templates. This include file will be built into all ShopSite themes, version 14 sp1 and newer. In v12 sp2 through v14, most responsive design themes have HTML schema markup and also do not need this code.

1. Download & upload the json-microdata.sst Include File.

Download this json-microdata.sst include file, un-zip it, and upload it in your ShopSite store under Merchandising > Custom Templates > Includes > Upload Include File.

Here is what is already inside the json-microdata.sst file you are downloading:

<script type="application/ld+json">{"@context": "http://schema.org/",
"@type": "Product",
"name": "[-- PRODUCT.Name JS_ENCODE --]",
[-- IF PRODUCT.SKU --]"sku": "[-- PRODUCT.Sku --]",[-- END_IF --]
"image": [[-- IF PRODUCT.MoreInformationGraphic --]"[-- PRODUCT.MoreInformationGraphic URL_ONLY --]"[-- ELSE_IF PRODUCT.Graphic --]"[-- PRODUCT.Graphic URL_ONLY --]"[-- END_IF --]
[-- FOR VAR.I 1 20 --][-- IF PRODUCT.MoreInfoImage[VAR.I] --],"[-- PRODUCT.MoreInfoImage[VAR.I] SS_SIZE0 URL_ONLY --]"[-- END_IF --][-- END_FOR --]],
[-- IF PRODUCT.ProductDescription --]"description": "[-- PRODUCT.ProductDescription JS_ENCODE --]",[-- END_IF --]
[-- IF PRODUCT.GoogleMPN --]"mpn": "[-- Product.GoogleMPN --]",[-- END_IF --]
[-- IF PRODUCT.GoogleGTIN --]"gtin": "[-- Product.GoogleGTIN --]",[-- END_IF --]
[-- IF PRODUCT.Brand --]"brand": {"@type": "Thing","name": "[-- PRODUCT.Brand JS_ENCODE --]"},[-- END_IF --]
[-- IF REVIEWS --][-- IF REVIEWS_COUNT_NUMBER GE 1 --]"aggregateRating": {"@type": "AggregateRating","ratingValue": "[-- REVIEWS_STARS_NUMBER --]",
"reviewCount": "[-- REVIEWS_COUNT_NUMBER --]"},[-- END_IF --][-- END_IF --]
[-- IF PRODUCT.DisplayPrice --]"offers": {"@type": "Offer","priceCurrency": "[-- STORE.CurrencyCode --]","price": "[-- IF PRODUCT.SaleAmount --][-- IF PRODUCT.SaleOn --][-- PRODUCT.SaleAmount RAW_NUMBER --][-- ELSE --][-- PRODUCT.Price RAW_NUMBER --][-- END_IF --][-- ELSE --][-- PRODUCT.Price RAW_NUMBER --][-- END_IF --]",
[-- IF STORE.Name --]"seller": {"@type": "Organization","name": "[-- STORE.Name REMOVE_HTML --]"},[-- END_IF --]"itemCondition": "[-- PRODUCT.GoogleCondition --]","availability": "[-- IF PRODUCT.GoogleAvailability "in stock" --]InStock[-- ELSE_IF PRODUCT.GoogleAvailability "out of stock" --]OutOfStock[-- ELSE --]PreOrder[-- END_IF --]","url":"[-- PRODUCT.MoreInfoURL --]"}[-- END_IF --]
}</script>

 

2. Link this include file in your product template

Add [-- INCLUDE json-microdata.sst PROCESS --] in your product template's DEFINE MORE_INFO_PAGE section, just before the </body> tag.

[-- INCLUDE json-microdata.sst PROCESS --]
</body>

 

3. Publish and Test

Go to Utilities > Publish, and regenerate your store pages. Once your store pages have been updated, test that the microdata is registering correctly by using Google's Structured Data Testing Tool. Enter the URL to one of your products' more information pages and check that the product information is displaying correctly.