Database Data into Schema Structured Data

Hello!

I have a dynamic page of type Listing - homeUrl.com/listings/{page-name}

On that page, I serve up a number of items in a repeating group, lets call them Results. The RG Results are based on filters which exist inside the Listing data type.

I want to submit each of those Results in an array as part of the Offers schema, which would require getting information about each Result from the database.

Schema is injected into the < head > of the page, which means that the Do A Search for… lookup is not executed before the page is loaded and so the Offers array ends up being empty.

Does anyone have any ideas on how you might be able to get that info about specific Results into the Offers schema?

You can add the JSON-LD schema anywhere on a page. Google will pickup and index the Offers schema if you add it into each Repeating Group “Results”.

In other words, JSON-LD does not have to be in the page Head. You can add it within the Repeating Group.

You can use Google tools to confirm this https://search.google.com/test/rich-results eg

https://search.google.com/test/rich-results/result?id=BBToCglK6x2yUoojTDW80w

Thank you!