Skip to content
Published Authored byBilly Reiner

Schema · How-to

Shopify GTIN, UPC, EAN, ISBN schema

GTIN (Global Trade Item Number) is the umbrella term for the family of universal product identifiers — UPC-A (12 digits, US/Canada), EAN-13 (13 digits, international), EAN-8 (8 digits, small products), ITF-14 (14 digits, cases/cartons), ISBN (books). Schema.org Product exposes gtin (generic), gtin8, gtin12, gtin13, and gtin141. Shopify stores all of these in one field: Barcode (Admin > Products > [product] > Inventory > Barcode (ISBN, UPC, GTIN, etc.))2. Shopify themes typically do NOT auto-emit GTIN to the correct schema property; the merchant authors the mapping.

Shopify's own Catalog optimisation doc names Barcode among the seven product fields AI platforms read. Google Merchant Center requires GTIN for most product categories. The 2026 install: emit the GTIN value to the schema property that matches its length — gtin12 for 12-digit UPCs, gtin13 for 13-digit EANs, gtin8 for 8-digit EANs, gtin14 for 14-digit cases.

What GTIN is

GTIN is the GS1 standard global identifier for trade items. The four common lengths: GTIN-8 (8 digits, small products like cosmetics), GTIN-12 / UPC-A (12 digits, US and Canada retail), GTIN-13 / EAN-13 (13 digits, Europe and international), GTIN-14 / ITF-14 (14 digits, packaging cases and cartons). ISBN-10 and ISBN-13 are book-specific GTINs. Schema.org also accepts the generic gtin property when the merchant doesn't know which length they're emitting; Google's Product documentation recommends the length-specific property when available.

Mental model: GTIN is the universal product ID that lets Amazon, Google, ChatGPT, and every distributor refer to the same product across systems. A Shopify merchant assigning GTINs to their own products contributes their catalog to the global trade graph; a Shopify merchant reselling third-party products inherits the manufacturer's GTINs and should emit them verbatim.

Shopify's Barcode field

Shopify exposes the GTIN as a single Barcode field on every product variant: Admin > Products > [product] > Variants > [variant] > Inventory > Barcode (ISBN, UPC, GTIN, etc.). The Liquid object is product.selected_or_first_available_variant.barcode (or variant.barcode in variant loops). Shopify does not validate the format — you can store any string. The validation happens downstream at Merchant Center, in the schema validator, and at Catalog ingestion.

Which gtin property to use

The decision tree per Schema.org and Google's recommendation: 8-character barcode emits gtin8, 12-character emits gtin12, 13-character emits gtin13, 14-character emits gtin14, ISBN-10 (10 chars) emits isbn AND gtin (Book subtype only), ISBN-13 (13 chars, starts with 978 or 979) emits gtin13 (it IS an EAN-13). Anything else (custom internal codes, MPNs) goes in mpn, not gtin.

  • 8 digitsgtin8 (small-product EAN-8).
  • 12 digitsgtin12 (UPC-A — US and Canada retail).
  • 13 digitsgtin13 (EAN-13 — international, including ISBN-13 for books).
  • 14 digitsgtin14 (ITF-14 — cases, cartons).
  • 10 digits (ISBN-10)isbn on Book subtype. Schema.org does not have a gtin10 property; ISBN-10 is book-specific.
  • Other (MPN, internal SKU stored in Barcode) — do not emit gtin. If it's a Manufacturer Part Number, use mpn instead.

JSON-LD example — length-aware gtin mapping

The block below detects the Barcode field's length and emits the correct gtin property. Paste inside main-product.liquid as part of the complementary Product block. The Liquid case statement handles the common lengths; unmatched lengths fall through with no gtin emission.

JSON-LD Length-aware GTIN mapping from product.barcode
 {%- assign barcode = product.selected_or_first_available_variant.barcode -%} {%- assign len = barcode | size -%} {%- if barcode != blank -%} {%- case len -%} {%- when 8 -%} "gtin8": "{{ barcode }}", {%- when 12 -%} "gtin12": "{{ barcode }}", {%- when 13 -%} "gtin13": "{{ barcode }}", {%- when 14 -%} "gtin14": "{{ barcode }}", {%- else -%} "gtin": "{{ barcode }}", {%- endcase -%} {%- endif -%} 

Merchant Center alignment

Google Merchant Center requires GTIN for most retail product categories (apparel exempted in some markets; handmade and vintage exempted globally). When Merchant Center has a GTIN in the feed and the storefront's Product JSON-LD emits a different GTIN — or no GTIN at all — the product gets flagged in Merchant Center diagnostics, and the listing can be suspended. The fix is consistency: same GTIN, same length-property, same product.

For Shopify stores using Shopify's official Google & YouTube channel (or a third-party Merchant Center sync app), the feed pulls product.barcode and maps it to Merchant Center's gtin attribute. Verify the feed in Merchant Center diagnostics; verify the schema in Rich Results Test; they must agree.

Validation

Rich Results Test against a PDP with gtin emitted should report Product detected, the gtin property parsed, zero errors. Common warnings: 'gtin format is invalid' (the value doesn't match the standard digit format — likely a non-digit character in the Barcode field). Schema.org Markup Validator parses all gtin properties as Text and doesn't validate the GTIN check-digit; Google's validator does.

A subtle gotcha: Shopify allows Barcode to contain spaces or hyphens (sometimes manufacturers ship product packaging with formatted barcodes like '5012345-678900'). The schema property expects unformatted digits only. Pass through | remove: '-' | remove: ' ' in Liquid to strip formatting characters before emitting.

Shopify gotchas on GTIN

Four gotchas. First: storing internal SKUs in the Barcode field — these are NOT GTINs and should not be emitted to a gtin schema property. Use mpn for manufacturer codes, sku for internal codes. Second: hard-coding gtin13 when some products have UPC-A (12-digit). Use the length-aware branch. Third: forgetting that variants have their own barcodes — product.barcode in some Liquid contexts returns the first variant's barcode, not the selected one. Use product.selected_or_first_available_variant.barcode for accuracy. Fourth: leaving Barcode empty on handmade/vintage products and then emitting an empty gtin field — wrap the emission in a Liquid conditional.

A fifth gotcha for multi-variant products: each variant can have its own barcode. Schema.org Product accepts one gtin per Product object, which means the JSON-LD reflects only the selected variant's barcode at any given page load. For products with five sizes each with distinct GTINs, the complete representation is a ProductGroup with hasVariant where each variant Product carries its own gtin. The full pattern is in Google's variant documentation.