Floddy Floddy - 3 years ago 174
Javascript Question

Join splitted JSON-LD data?

On an ecommerce website, we output JSON-LD data. The issue is, that we output our own product data (

, etc.), and then an external service (Yotpo) outputs the rating data using JavaScript, that is hosted by Yotpo.

The issue with this is that Google seems to interpret this as two separate products:

Our data:

@type Product
name MyProduct
sku MY-SKU
image http://example.com/image.jpg
url http://example.com/product
description Lorem ipsum
@type Offer
availability http://schema.org/InStock
price 749.00
priceCurrency NOK
@type Organization
name Foo Bar

Yotpo's data:

@type Product
name MyProduct
@type AggregateRating
ratingValue 4.5
reviewCount 2

Are there any ways to 'join' these two without modifying the part Yotpo inserts?

Answer Source

Solved this by turning off Yotpo's javascript-injected snippet, but still having the rich snippets option on (you need to keep the option on to be able to fetch the data, disabling only the javascript-injected snippet is only doable by contacting their support), and then fetching the data via their API and inserting it into our own data

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download