
Written By
Joris Borgers
Seoul, South Korea
Joris likes to travel all over the world. He loves the latest developments in coding. He finds it exciting to find the best solution for clients. Realising the best solution in cooperation with the World of Wix specialists is Joris at his best.
This one is for all e-commerce fanatics! Completing this article will greatly improve your product findability. Google is the most used search engine in the world, and when a user searches for a product it will show a list of products above all other search results. This article will make sure YOUR product can be on that list.
Implementing this requires advanced Velo/Javascript knowledge. Are you not comfortable with coding? then we recommend hiring one of our Velo certified developers.
Getting ready
Sadly, it is not possible to modify the normal Wix store product pages with code. Google only produces rich search results based on pages that display individual products. That means that if you want to be featured on the google shopping list you need to convert your standard Wix store pages to dynamic pages. You can reference this article for a step-by-step guide. The products database that gets used by the dynamic page should, at the minimum, contain the following fields:
title (text)
description (text)
sku (text)
images (media gallery)
price (text)
priceValidUntil (text) saved as YYYY-MM-DD
The package also uses the following information out of your Dashboard settings.
Business name
Contact email
Site currency
Now let's code!
First, we need to add the SEO Structured Data for Products Velo Package to the website. Now go to the dynamic product page and add the following section of code:
import wixSeo from 'wix-seo';
import { buildSchema } from '@velo/seo-structured-data-product-backend';
import wixLocation from 'wix-location';
$w.onReady(async function () {
const schemaPromise = new Promise((resolve, reject) => {
$w('#myDynamicDataset').onReady(async () => {
const siteBaseUrl = wixLocation.baseUrl;
const currentItem = $w('#myDynamicDataset').getCurrentItem();
const schema = await buildSchema(currentItem, siteBaseUrl);
resolve(schema);
});
});
const resolvedSchema = await schemaPromise;
if (resolvedSchema) {
wixSeo.setStructuredData([resolvedSchema]);
}
});
Don't forget to change the $w('#myDynamicDataset') to your dataset name.
That's it! Your products can now be indexed by google shopping 🚀. You can use this google page to test if your product page is being indexed correctly.
