Skip to main content

How do I set a custom product category in JSON LD?

Custom product category in JSON LD.

Written by Julia

By default, our app fills the JSON LD product category from the product category set in your Shopify admin (the Shopify product taxonomy). Shopify translates taxonomy names to the storefront language, so this category is only output on English storefronts. On storefronts in other languages, no category is output for products that have a Shopify category. If a product has no Shopify category (or it's "Uncategorized"), the product type is used instead, in every language.

To set the category yourself, for example to show a category on non-English storefronts or to use a Google product category, we’ve set up a custom metafield integration. The value you set takes priority over the product taxonomy and the product type on every storefront, and it's the only way to get a category on storefronts that aren't in English.

Go to your Shopify admin → Settings → Metafields and metaobjects and under Products section click Add definition.

When creating a new metafield, set the Namespace and key to custom.google_product_category and choose Single line text as the metafield type.

Next, open any product in your Shopify admin and fill in the category. We recommend the full path from the Google product taxonomy, for example Apparel & Accessories > Clothing > Shirts & Tops. The value is shown in JSON LD exactly as you type it.

Click "Save" and that’s it - our app will handle the rest!

Did this answer your question?