简体   繁体   中英

How to update wix Structured data in Javascript?

I have a e-shop made with wix and try to add fields (aggregateRating) to the sturctured data on my product page.

According to the wix doc, you need to use wixSeo.setStructuredData().

But first I want to fetch the actual structuredData and according to the wix doc, you need to use wixSeo.structuredData but it returns an empty array. But if I test my page in the google rich results testing page, I can see my structured data.

So I'm a bit lost.

Sorry for my bad english and thanks for your help.

It seems like you're taking the right steps, eg:

  1. Get the current structured data object
  2. Enrich it
  3. Set the enriched structured data object.

Since you mentioned that Google's rich results tool correctly identifies the structured data on the page, the problem is probably in the way your code is fetching the current structured data object.

To resolve this, I recommend posting your code here or on the Velo Forum to get debugging tips from the community.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM