Pendium
Model IntelligenceThe Optimization Playbook

How to map Shopify size data to schema for AI shopping recommendations

Claude

Claude

·8 min read
How to map Shopify size data to schema for AI shopping recommendations

When a shopper asks ChatGPT or Gemini for a "women's puffer jacket size medium, under $150," the recommendation engine ignores unstructured variant dropdowns and queries machine-readable schema. Most apparel brands bury sizing inside concatenated variant titles like "Medium / Forest Green," rendering their catalog invisible to conversational shopping agents. Pendium tracks how commercial LLMs evaluate product feeds, and our visibility data shows that mapping size charts and fit specs to schema.org SizeSpecification objects is what keeps apparel brands visible in filtered queries. By establishing a three-layer sizing architecture across JSON-LD markup, Shopify metafields, and conversational fit answers, merchants can capture high-intent buyers filtering on exact measurements.

The variant title trap costing you AI visibility

Shopify stores every product variant under a single concatenated string. If you sell a cotton crewneck in green and medium, Shopify records the variant title as Medium / Forest Green or M / Blue / Cotton. That string populates your storefront dropdown, your admin inventory screens, and standard theme JSON-LD templates. Human shoppers read the two options separated by a slash without difficulty, but AI shopping agents do not parse variant titles like humans.

When autonomous agents crawl a product page or ingest an API catalog, they look for typed, explicit attributes. An agent evaluating a prompt for an exact fit expects a dedicated size entity, an unambiguous sizeSystem, and clear measurements. When an AI crawler encounters an unparsed string like M / Forest Green, it has to guess which token represents the size, which represents the color, and what standard that sizing follows. Rather than risk recommending an incorrect fit, recommendation algorithms often bypass the product entirely.

According to a study on Shopify clothing size schema for AI shopping agents, over 96% of Shopify apparel stores have no SizeSpecification markup in their product JSON-LD. At the same time, size ranks as the most frequently filtered attribute in apparel queries, ranking ahead of both color and price. Merely driving traffic through paid social campaigns no longer covers this deficit. As discussed in our analysis of AI Visibility for DTC Brands, buyers increasingly consult conversational interfaces before buying, and brands that omit structured attributes disappear from consideration sets.

Data layerHuman shopper experienceAI agent interpretationSurfacing outcome
Variant title string (M / Blue)Reads dropdown label naturallyMust guess which token is size vs. colorHigh risk of hallucination or exclusion
Standard Shopify OptionSelects button on product pageSees unstructured string without systemAgent cannot confirm international fit
Schema SizeSpecificationInvisible behind the page codeReads explicit sizing standard, group, and dimensionsClean match for filtered recommendations

Just as merchants must configure Shopify unit price schema to win AI shopping recommendations on volume goods, apparel brands must provide distinct sizing data points. Without explicit markup, your catalog forfeits every query that specifies a size requirement.

From above of crop anonymous carpenter typing on netbook at workbench with assorted tools in workroom

The three layers of AI-readable sizing

Shopify's internal documentation on platform optimization singles out three apparel-specific fields for algorithmic surfacing: sizing guides, material information, and care instructions. To satisfy both shopping models and human buyers, apparel merchants need to organize sizing across three distinct layers.

  • The engine-readable layer provides machine-interpretable JSON-LD schema containing exact size types and body measurements.
  • The structured layer uses Shopify native metafields to store standardized measurement values per product and variant.
  • The conversational layer supplies clear text answers for natural-language inquiries regarding fit, shrinkage, and sizing transitions.

The engine-readable layer (Schema)

The technical backbone of machine-readable fit is the SizeSpecification - Schema.org type. Instead of passing sizing as a generic text property, SizeSpecification nests within your Product or ProductGroup structured data to state the exact classification of each variant.

This schema type accepts specific properties that resolve sizing ambiguity:

  • name: The merchant size label (for example, "M", "32x34", or "10").
  • sizeGroup: The population or cut category, such as regular, petite, or maternity.
  • sizeSystem: The national or regional standard used to measure the garment.
  • hasMeasurement: Detailed physical dimensions expressed as a QuantitativeValue.

Below is an example of valid JSON-LD that defines a medium women's jacket with explicit chest dimensions:

{
  "@context": "https://schema.org/",
  "@type": "Product",
  "name": "Down Winter Puffer",
  "sku": "DWP-M-BLK",
  "size": {
    "@type": "SizeSpecification",
    "name": "Medium",
    "sizeGroup": "https://schema.org/WearableSizeGroupRegular",
    "sizeSystem": "https://schema.org/SizeSystemUS",
    "hasMeasurement": {
      "@type": "QuantitativeValue",
      "name": "Chest",
      "value": 38,
      "unitCode": "INH"
    }
  }
}

When an agent encounters this payload, it does not need to parse arbitrary text. It recognizes immediately that the product fits a US Regular Medium with a 38-inch chest measurement.

The structured layer (Metafields)

Writing static schema directly into theme files fails because different garments require different measurement sets. A jacket requires chest and sleeve lengths. Pants require waist and inseam measurements. Footwear requires foot length and width metrics.

To manage this cleanly in Shopify, use native product and variant metafields. By defining a measurement set under a custom namespace—such as sizing.measurements—you give your operations team a standardized input form in the Shopify Admin. Your theme's Liquid templates then read these metafield values to generate your on-page size charts and your JSON-LD payloads simultaneously.

The conversational layer (FAQs)

AI agents do not solely query structured attributes; they also synthesize direct answers for subjective user prompts. Shoppers frequently ask conversational questions like "Does this jacket fit true to size?" or "Should I size up if I have broader shoulders?"

If your store leaves these questions unanswered, the AI model generates an answer based on generic web sentiment or customer reviews from third-party sites. To direct this conversation, publish clear fit guidance on your product detail page marked up with FAQPage schema. State whether garments run small, detail fabric stretch characteristics, and specify which body measurements fall between sizes.

Assigning the right size systems and groups

Size codes without system definitions create major recommendation issues. A size 8 in the United Kingdom corresponds to a size 4 in the United States and a size 36 in France. When an AI shopping assistant evaluates products for an international user, a bare numeric or letter code provides zero regional context.

Defining the measurement scale (sizeSystem)

To establish the measurement system, assign the sizeSystem property using Schema.org enumerations. As documented in the SizeSystemEnumeration - Schema.org Enumeration Type specification, platforms recognize standardized values for both country codes and measurement methodologies:

  • SizeSystemUS: Standard United States sizing.
  • SizeSystemMetric: Garments sized strictly by centimeters (common in continental Europe and Japan).
  • SizeSystemImperial: Sizing defined by inches (such as denim waist and inseam combinations).
  • Regional standard tokens including UK, EU, JP, and CN sizing scales.

In your Liquid schema templates, map your internal country assignments to these Schema.org URLs. When an agent processes the payload, it uses these definitions to convert sizes accurately for users shopping across regions.

A tailor uses a tape measure on a suit jacket displayed on a mannequin, showcasing the craft of tailoring.

Targeting the audience segment (sizeGroup)

The sizeGroup attribute identifies the intended body segment or cut type. Standard size codes shift dramatically based on whether a garment belongs to a petite, plus, or tall line. Schema.org provides standard enumerations for wearable size groups:

  • WearableSizeGroupRegular: Standard off-the-rack sizing.
  • WearableSizeGroupPetite: Scaled for shorter torsos and shorter inseams.
  • WearableSizeGroupPlus: Tailored for larger body proportions.
  • WearableSizeGroupTall: Extended sleeve lengths, inseams, and torso drops.
  • WearableSizeGroupMaternity: Cut to accommodate pregnancy proportions.

Mapping these groups directly allows an agent to answer specific shopper requirements. When a user asks an AI tool for "tall size men's oxford shirts," the engine filters out catalogs that rely on generic labels and ranks merchants using explicit WearableSizeGroupTall properties.

Managing per-product size charts with metafields

Maintaining unique sizing data for hundreds of SKUs requires a systematic approach. Hardcoding HTML tables into product descriptions creates a maintenance bottleneck and prevents data from serializing into JSON-LD. The cleaner method involves per-product metafield definitions, as outlined in the technical guide on How to Add a Size Chart with Metafields in Shopify.

To build this structure inside Shopify:

  1. Navigate to Settings > Custom data > Products inside your Shopify Admin.
  2. Click Add definition and name the field "Size Chart Reference".
  3. Assign the namespace and key to sizing.chart.
  4. Select Page reference or Metaobject as the type. This lets you write one master size chart for "Men's Tops" and attach it to fifty different shirts.
  5. Create variant-level definitions under Settings > Custom data > Variants for explicit measurements, using keys like sizing.chest_inches or sizing.waist_inches.

Once defined, edit your Shopify theme's product schema template (typically located in snippets/product-json-ld.liquid or sections/main-product.liquid) to loop through variants and serialize these values:

{%- for variant in product.variants -%}
  {
    "@type": "Product",
    "name": {{ product.title | append: ' - ' | append: variant.title | json }},
    "sku": {{ variant.sku | json }},
    {%- if variant.metafields.sizing.chest_inches -%}
      "size": {
        "@type": "SizeSpecification",
        "name": {{ variant.option1 | json }},
        "sizeSystem": "https://schema.org/SizeSystemUS",
        "sizeGroup": "https://schema.org/WearableSizeGroupRegular",
        "hasMeasurement": {
          "@type": "QuantitativeValue",
          "name": "Chest",
          "value": {{ variant.metafields.sizing.chest_inches | json }},
          "unitCode": "INH"
        }
      },
    {%- endif -%}
    "offers": {
      "@type": "Offer",
      "price": {{ variant.price | money_without_currency | json }},
      "priceCurrency": {{ cart.currency.iso_code | json }},
      "availability": "https://schema.org/{% if variant.available %}InStock{% else %}OutOfStock{% endif %}"
    }
  }{% unless forloop.last %},{% endunless %}
{%- endfor -%}

This Liquid snippet checks for the presence of your measurement metafield on each variant. When populated, it generates a complete SizeSpecification payload containing exact dimensional values.

Two male couriers discussing and signing a clipboard in a warehouse setting, surrounded by packages.

One thing to watch out for: The missing system attribute

The most common implementation mistake merchants make is outputting SizeSpecification with a size name and body measurement while leaving sizeSystem blank.

When an AI shopping agent parses a schema block containing name: "36" without an identified system, the agent cannot determine whether "36" represents a French women's jacket, an American men's suit jacket chest size, or a waist measurement in inches. In testing across platforms like ChatGPT, Claude, and Gemini, models treat ambiguous numbers as untrusted data. When confidence drops below internal safety thresholds, recommendation agents discard the product and select a competitor whose schema defines explicit units and regional boundaries.

To avoid this error:

  • Always pair every hasMeasurement block with an explicit unitCode ("INH" for inches, "CMT" for centimeters).
  • Always specify the canonical sizeSystem URI rather than arbitrary merchant abbreviations.
  • Validate your live templates through Google's Rich Results Test and Schema.org's Validator to verify that property paths resolve without syntax warnings.

Auditing your sizing data across AI platforms

Fixing your theme templates resolves the technical data pipeline, but you still need to verify whether commercial language models recognize your products during real shopping conversations. Recommendation algorithms update their internal representations independently of traditional search indices, frequently combining web crawling, merchant feeds, and user-prompt context.

Pendium tracks how AI engines evaluate brands across 7 platforms: ChatGPT, Claude, Gemini, Grok, Perplexity, DeepSeek, and Google AI Overviews. Using tools like the Agent Experience Engine, merchants can monitor real buyer queries, identify size and fit gaps across different customer personas, and pinpoint where competitors capture recommendations.

Visit Pendium.ai to run a free visibility scan. You will receive an analysis of how major AI assistants currently interpret your catalog, identify missing structured data attributes, and learn what models say when buyers search for your products.

how-toschemashopify-seo

Get the latest from The Citation Report delivered to your inbox each week