The SEO Structured Data for Products package generates structured data about your site’s products based on schema.org requirements. Inserting this data into a product page’s <head>
section allows Google to provide rich search results for that page.
Google requires certain information about your site and products in order to produce rich search results. The package collects these details from various databases across your site. Follow the steps below to make sure all the information you need is available.
Key | Field Type |
---|---|
title (usually automatically generated) | Text |
description | Text |
sku | Text |
images | Media Gallery |
price | Text |
priceValidUntil | Text (YYYY-MM-DD) |
Google produces rich search results based on pages that display individual products. These pages can be easily set up in Wix by creating dynamic pages based on the collection that contains your product details.
’#myDynamicDataset’
with the ID of the dataset on your page:
This code uses the package to generate the structured data for a product and writes it to the product’s page using the wix-seo
API. The call to wix-seo
is outside of the Promise in the code because it cannot be called within the dataset's onReady()
function.
The config.js file allows you to set the following options:
addedLabels
array.Note: You can use Google's rich search result test to confirm that you have set up the package correctly.
This package contains the following backend files. Note that only exported functions that you can use in your site are listed here.
The code in this file collects information from across your site and generates structured product data that meets Google’s requirements for producing rich search results.
To use the function below in your code, import it with the following syntax:
This file contains the following function:
buildSchema()
Arranges several chunks of site data together into complete structured data about a product.
Syntax:
async function buildSchema(item: object, baseUrl: string): Promise<json>
Parameters:
Returns:
A JSON object containing complete structured data about a product.
Example Return Object:
The code in this file contains constant variables that are used in schemaBuilder.jsw.
The code in this file contains user-definable variables that are used in schemaBuilder.jsw.
1.0 Initial version.
SEO, structureddata, productschema