Skip to content

Render product structured data (JSON-LD) from the theme #87

Closed

Description

@next-devin

Spark product pages use the platform's {% seo %} tag for their structured product data (schema.org JSON-LD). That markup has problems that cost merchants rich results in Google and give AI shopping tools wrong or missing product data:

  • It is invalid JSON whenever the description has a line break or the title or description contains a double quote or backslash. Google then ignores the whole block.
  • brand is always the store name.
  • The UPC is emitted as mpn, and there is no gtin.
  • A product with variants is one Product with one price, so variant prices, availability and identifiers are missing.
  • The JSON-LD description is cut at 160 characters.

Spark can fix this itself by overriding the product page's seo block with its own partial, without waiting on a platform change.

Done when

  • Product pages render their meta, Open Graph and JSON-LD from a Spark partial.
  • A product with variants is a ProductGroup with one Product and Offer per variant.
  • Brand, GTIN and MPN can come from product metadata; the UPC is used as the GTIN only when it is a valid GTIN length.
  • Every string is JSON-escaped, so quotes and line breaks in product text produce valid JSON.
  • Google's Rich Results Test reports no critical issues for a product with variants on a real store.

Activity

  1. self-assigned this
    on Oct 29, 2026
  2. added
    enhancement
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions