Skip to content

Schema.org Structured Data Straight From Your Backend

Search engines show prices, availability and star ratings next to a product page when the page describes the product in structured data: a block of Schema.org JSON-LD that says, in a vocabulary Google, Bing and AI assistants all read, this is a Product, it costs 89.90 EUR, it is in stock, and 214 people rated it 4.6.

Most shops add that block late, by hand. Their database has its own column names, so somebody writes a mapping from products.title and prices.amount_cents to name and offers.price, and keeps it in step every time either side changes. The mapping drifts, the structured data goes stale, and the rich results quietly disappear.

ObjectsGrid takes the other road: the data is modeled on Schema.org from the start, so the structured data is the data.

Why structured data matters

  • Rich results. Google can show a product's price, availability, shipping, return policy and rating in search results and in Google Shopping. Those results draw more clicks than a plain blue link.
  • AI shopping assistants. Language models and shopping agents read structured data to compare products. A page without it leaves them guessing from the prose.
  • Fewer mistakes. When Google sees a price on the page that doesn't match the structured data, the product can lose its rich result. One source for both avoids that.

Data that is already Schema.org

Every ObjectsGrid object of a Schema.org type carries its vocabulary and type, and its fields use the Schema.org names. A Product has name, description, sku, gtin13, image, brand, offers, aggregateRating and review; an Offer has price, priceCurrency, availability, shippingDetails and hasMerchantReturnPolicy. Your return terms and shipping services are objects of their own, a MerchantReturnPolicy and ShippingServices, defined once and referenced by your Organization, where Google looks for shop-wide policies. Enumerated values are Schema.org URLs, such as https://schema.org/InStock, and currencies are ISO 4217 codes. There is nothing to map.

Two spellings differ, because JSON-LD's @ keywords aren't valid field names in GraphQL and most languages:

ObjectsGrid JSON-LD
at_context @context
at_type @type
at_value @value
at_language @language

See the data model for the full picture.

From objects to JSON-LD in four steps

ObjectsGrid now does these steps for you: ask for an object with Accept: application/ld+json and you get its finished document, with your own page addresses. See JSON-LD for your pages. The steps below are what it does, for when you build the markup yourself.

  1. Read the product and what it references. Schema.org links objects rather than nesting them, so a product's brand holds a reference to a Brand, {"at_id": "<its URL>", ...}, and its offers are the Offers that point to it. Read them too; with the GraphQL API you get them all in one request, which is billed once.
  2. Pick the page's language. Names and descriptions are lists of language-tagged strings, one per language. Use the value in the language of the page you are rendering, or ask the REST API for one language with lang.
  3. Rename the at_ fields to their @ spelling, and embed the brand and offers in place of their URLs.
  4. Leave out the ObjectsGrid-only fields id, tags and meta, and set url to your product page's address.

A product, its brand and one offer become:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Trail Running Shoe",
  "description": "Lightweight shoe with a grippy sole for muddy trails.",
  "sku": "TRS-42-BLUE",
  "gtin13": "4006381333931",
  "image": "https://shop.example.com/images/trs-42-blue.jpg",
  "url": "https://shop.example.com/shoes/trail-running-shoe",
  "brand": {"@type": "Brand", "name": "Northpeak"},
  "aggregateRating": {"@type": "AggregateRating", "ratingValue": 4.6, "reviewCount": 214},
  "offers": {
    "@type": "Offer",
    "price": 89.90,
    "priceCurrency": "EUR",
    "availability": "https://schema.org/InStock"
  }
}
</script>

Write that conversion once, as a small function in your storefront. It doesn't change when you add a field, because the field already has its Schema.org name.

Check it

Paste a product page into Google's Rich Results Test or the Schema Markup Validator. Google lists the fields it wants for each rich result in its product structured data guide; a price, a currency and availability on the offer are the ones most often missing.

Beyond products

The same goes for the rest of the catalog. An Organization and its Places, with addresses, coordinates and opening hours, give a store locator its LocalBusiness markup; Reviews, Offer catalogs, Events with their tickets, Courses and loyalty programs with member prices are Schema.org types too. ObjectsGrid's own types, such as carts, configuration and feature flags, aren't, and carry no at_context.

Your backend and your search appearance describe the same thing in the same words. Start with the quick start, or see what else is included on the features page.