CatalogScan

Technical Reference

Shopify Metafields for AI Agents: Implementation Reference (2026)

Shopify metafields are the mechanism for attaching structured product attributes that standard Shopify fields don't support — material, age group, MPN, product type taxonomy, and more. The two namespaces AI shopping agents use most are the Shopify Standard Product Taxonomy namespace and the Google Shopping metafield namespace. This guide covers how to create, populate, and map both to JSON-LD output.

TL;DR The metafields AI agents care about live in two namespaces: custom.shopify (Shopify Standard Taxonomy, syncs to Shopping Graph automatically) and mm-google-shopping (Google Shopping attributes, synced by Google & YouTube app). The 8 fields that move the CatalogScan score are: brand, gtin13 (actually the variant barcode field, not a metafield), mpn, material, color, size_type, age_group, and product_category. For the analysis of which 8 move the score most, see the metafields blog post. This page is the implementation reference.

The two namespaces that matter

1. Shopify Standard Product Taxonomy (custom.shopify.*)

Shopify's Standard Product Taxonomy is a hierarchical product classification system (similar to Google's product taxonomy) that Shopify introduced in 2023. When you set a product's Product category in Shopify Admin, Shopify assigns the product to a node in the taxonomy tree and makes the taxonomy attributes available as pre-defined metafields.

These metafields appear in Admin under a product's Specifications section (for taxonomy-enabled categories). They sync to Google Merchant Center automatically via the Google & YouTube app, mapping to the equivalent Google product attributes. Setting them is the most efficient path to populating Merchant Center attributes — you fill them once in Shopify and they flow to Google without a separate feed file.

2. Google Shopping namespace (mm-google-shopping.*)

The Google Shopping namespace is a set of metafield definitions installed by the Google & YouTube app. These metafields map 1:1 to Google Merchant Center feed attributes. If the Standard Taxonomy doesn't cover a field you need (for example, identifier_exists for GTIN-exempt products, or custom_label_0 for campaign segmentation), you add it here.

Key difference: Standard Taxonomy metafields appear in the product form under "Specifications." Google Shopping metafields appear under "Metafields" at the bottom of the product editor. Both sync to Merchant Center; they're just different entry points.

The 8 metafields — reference table

Note: GTIN is not a metafield — it is the Barcode field on each product variant. It is listed here because it is the most impactful signal and is often confused with a metafield.

FieldNamespace / PathTypeImpactNotes
barcode (GTIN) Variant-level field string Critical Admin: Products → variant → Barcode. Not a metafield. Syncs as gtin to Merchant Center and Product JSON-LD.
product_category Standard Taxonomy taxonomy node Critical Admin: Products → Product category. Enables taxonomy-specific attribute metafields. Maps to Google's google_product_category.
brand mm-google-shopping.brand single_line_text High Brand/manufacturer name for resellers. Syncs as brand to Merchant Center. Also set in Product JSON-LD via theme Liquid.
mpn mm-google-shopping.mpn single_line_text High Manufacturer Part Number. Secondary cross-retailer identifier after GTIN. Required for resellers; optional for private label.
material Standard Taxonomy single_line_text High Primary material (e.g., "100% organic cotton"). Available after setting product_category to an apparel/home category. Syncs to Merchant Center material attribute.
color Variant option or mm-google-shopping.color single_line_text High (apparel) Primary color. Shopify auto-syncs variant Color option to Merchant Center; use the metafield only if your variant option name differs (e.g., "Shade" instead of "Color").
age_group mm-google-shopping.age_group single_line_text Medium Valid values: newborn, infant, toddler, kids, adult. Required for apparel in Google Shopping. Prevents "Missing value [age_group]" disapprovals in Merchant Center.
identifier_exists mm-google-shopping.identifier_exists boolean Medium Set to false for legitimately GTIN-exempt products (handmade, custom, bundles). Prevents Merchant Center disapprovals for missing GTIN without suppressing approved products.

Creating metafields in Shopify Admin

Method 1: Admin UI (single product)

  1. In Shopify Admin, go to Settings → Custom data → Products
  2. Click Add definition. Set namespace and key exactly as listed in the table above (e.g., namespace: mm-google-shopping, key: mpn). Set type to Single line text.
  3. Save the definition. The field now appears in the product editor under "Metafields."
  4. On each product, scroll to the Metafields section and fill in the value.

The Google & YouTube app creates mm-google-shopping.* definitions automatically when you install it — you may already have these definitions and just need to populate values.

Method 2: Admin API (bulk update via script)

For catalogs with 50+ products, use the Shopify Admin API's POST /admin/api/2024-01/products/{product_id}/metafields.json endpoint. Below is the payload format for a single metafield:

POST /admin/api/2024-01/products/123456789/metafields.json

{
  "metafield": {
    "namespace": "mm-google-shopping",
    "key": "mpn",
    "value": "ACME-WB-100-BLK",
    "type": "single_line_text"
  }
}

For bulk updates, export your product CSV (Admin → Products → Export), add columns for each metafield value, then write a script to call the API per product. The Shopify Node.js or Python SDK makes this straightforward — see the metafields blog post for a working bulk script example.

Method 3: CSV import (metafield columns)

Shopify's product CSV import supports metafield columns in the format Metafield: namespace.key [type]. Export your current products to CSV, add columns for the metafields you want to populate, fill values, and re-import with "Overwrite existing products." Example column header:

Metafield: mm-google-shopping.mpn [single_line_text]

This method is the fastest for non-technical merchants doing a one-time bulk populate.

Mapping metafields to Product JSON-LD via Liquid

The Google & YouTube app handles Merchant Center sync. But for Product JSON-LD on your product pages (used by ChatGPT Shopping, Perplexity, and Bing Shopping), you need to output these values in your theme's JSON-LD Liquid template. Most Shopify themes do not include metafield values in their JSON-LD output by default.

Add these Liquid conditionals to your theme's JSON-LD block (typically in sections/product-template.liquid or a dedicated snippets/product-schema.liquid file):

{% comment %} Inside the Product JSON-LD script block {% endcomment %}
{
  "@type": "Product",
  "name": {{ product.title | json }},
  "description": {{ product.description | strip_html | json }},
  "brand": {
    "@type": "Brand",
    "name": {{ product.vendor | json }}
  },
  "offers": {
    "@type": "Offer",
    "price": {{ current_variant.price | money_without_currency | json }},
    "priceCurrency": {{ shop.currency | json }},
    "availability": "{% if current_variant.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}"
    {% if current_variant.barcode != blank %}
    ,"gtin13": {{ current_variant.barcode | json }}
    {% endif %}
  }
  {% assign mpn = product.metafields['mm-google-shopping']['mpn'] %}
  {% if mpn != blank %}
  ,"mpn": {{ mpn.value | json }}
  {% endif %}
  {% assign material = product.metafields['shopify']['material-2'] %}
  {% if material != blank %}
  ,"material": {{ material.value | json }}
  {% endif %}
}
Note: Taxonomy metafield key names vary by category (e.g., material-2 vs. material depending on the taxonomy node). Check your specific metafield key in Admin → Settings → Custom data → Products to find the exact key name for your product category's Specifications fields.

Bulk management tools

For ongoing metafield maintenance at catalog scale, these third-party apps in the Shopify App Store handle bulk edits without API scripting:

  • Metafields Guru — bulk export/import of metafields to CSV, field definitions, and support for all metafield types.
  • Bulk Product Editor by Hextom — bulk edits across products, variants, and metafields with filtering by collection or tag.
  • Shopify Flow (for automation) — create workflows that populate metafields when products are created or tagged, useful for maintaining metafield consistency as new products are added.

Common questions

Do metafields appear in the /products.json bulk feed that AI agents crawl?

No. The /products.json endpoint returns the standard Shopify product fields (title, description, variants with their barcode/price/inventory, images, tags, vendor, product_type). Metafields are not included in the public REST response. AI agents that ingest via /products.json do not see metafield values — those values only reach them via Merchant Center feed sync (for Google AI Mode) or via Product JSON-LD on individual product pages (for ChatGPT Shopping and Perplexity crawls). This is why mapping metafields to JSON-LD output matters.

My theme already outputs Product JSON-LD. Do I need to modify it?

Only if your current JSON-LD is missing metafield-sourced fields. View source on a product page and look for gtin13, mpn, and material in the JSON-LD block. If they're absent or empty while the metafields have values, the Liquid code is not reading them. Add the conditionals from the Liquid example above. If they're already populated, your theme is already mapping metafields to JSON-LD.

What is the difference between product.vendor and the mm-google-shopping.brand metafield?

product.vendor is Shopify's built-in vendor field — it's the brand as entered in the product form's "Brand" field. Most themes already output this as the JSON-LD brand property. The mm-google-shopping.brand metafield is specifically for the Merchant Center feed when the brand needs to differ from vendor (for example, a marketplace seller who uses a different brand taxonomy). For most merchants, using product.vendor is correct and the mm-google-shopping.brand metafield is redundant. Only add the metafield if Merchant Center is flagging brand disapprovals that product.vendor doesn't fix.

Do I need taxonomy metafields if I already have Google Shopping metafields set?

They serve different purposes. Google Shopping metafields (mm-google-shopping.*) sync specific attributes to Merchant Center. Standard Taxonomy metafields (custom.shopify.* Specifications) define what kind of product this is in Shopify's internal classification — which then tells Shopify which attributes are relevant. Setting the Product category is what unlocks the relevant Specifications fields for your product type. You want both: taxonomy for category classification (and the attributes it unlocks), and Google Shopping metafields for the attributes the taxonomy doesn't cover.

How do I audit which products are missing metafield coverage?

In Shopify Admin, go to Products → click the filter icon → filter by "Metafield" → select the metafield you want to audit (e.g., mm-google-shopping.mpn) → "is empty." This shows all products missing that field. For a catalog-level view across all metafields, export via the Admin API using GET /admin/api/2024-01/products.json?fields=id,title,metafields — note this requires a private app or custom app with product metafield read scope. Or use a bulk editor app from the list above, which displays metafield coverage visually.

Check how your Shopify store scores on structured data completeness — including brand entity format, GTIN coverage, and JSON-LD field quality.

Run the free CatalogScan →