Skip to content
Back to blog

Map Shopify Metafields to Google Merchant Center

How to map Shopify metafields like custom.color, custom.gender and custom.gtin to Google Merchant Center attributes, and the value rules Google enforces.

Alex DiazFounder, SnowPipeMay 8, 20269 min read
shopifygoogle-merchant-centermetafieldsproduct-feedsguide

Google asks apparel sellers for color, size, gender and age_group, and it also takes material and pattern. A Shopify product has no gender, age group or material field, and color and size exist only as variant options with whatever names the merchant typed. Most stores end up keeping these values in metafields such as custom.gender, and a metafield reaches Google only when something maps it to the attribute.

This is the how-to: which metafields are worth mapping, how to map them in Shopify's own channel mapping, when a feed tool is the better route, and the value formats Google rejects. If you have already mapped a metafield and the attribute is still empty in Merchant Center, go to the troubleshooting guide instead.

If your problem is the standard fields (price, availability, GTIN), SnowPipe syncs those from Shopify to Merchant Center and validates them first. You can try it free.

TL;DR

  • A metafield is not sent to Google because its key happens to match an attribute name. You map it, in Shopify's channel mapping or in a feed tool.
  • The six worth mapping first are color, size, gender, age_group, material and gtin.
  • Channel mapping is one mapping for every product on the channel. It supports combined values and Liquid filters but no if logic.
  • gender and age_group accept a fixed list of values. Mens and Kids 3-5 are not on it.
  • Multiple colors are separated with a slash. Google's color page warns that with commas "only one color will be applied".

What Shopify metafields are

A metafield is a custom field attached to a product, a variant or another Shopify object. It is identified by a namespace and key, such as custom.color, and it has a type: single_line_text_field, list.single_line_text_field, metaobject_reference, boolean and so on. Shopify's data type list has all of them.

You create definitions from the product or variant page, or under Settings > Metafields and metaobjects in the admin (older guides call this "Custom data"). Product metafields hold one value for the product. Variant metafields hold one per variant, which is what color and size need.

Shopify also has category metafields, standard attributes such as size, age group, fabric and target gender that come with a product's category. If you are starting from nothing, they are worth filling in before you invent custom.* fields.

What the Google & YouTube app sends without mapping

The Google & YouTube app sends Shopify's standard product details. Shopify's product sync page says that some data Google can use "isn't available from a product's details and needs to be added from the Google & YouTube channel", such as a brand and MPN for products without barcodes.

Values you enter in the channel itself, such as age group or gender, are stored in metafields in the mm-google-shopping namespace, and the channel's mappings already read those. Your own custom.* metafields are not used as a source until you map them.

The six metafield mappings that matter

Shopify metafieldGoogle attributeLevelNotes
custom.colorcolorVariantUp to 3 colors separated by /, max 100 characters
custom.sizesizeVariantFree text, max 100 characters
custom.gendergenderProductmale, female or unisex
custom.age_groupage_groupProductnewborn, infant, toddler, kids or adult
custom.materialmaterialProductUp to 3 materials separated by /, max 200 characters
custom.gtingtinVariant8, 12, 13 or 14 digits with a valid check digit

color, gender and age_group are required for apparel in Brazil, France, Germany, Japan, the UK and the US, and size for clothing and shoes in the same countries. Leaving them out is a common cause of disapproved products. The feed spec walkthrough has the full requirement table.

gtin is here for stores whose barcodes are not in the variant's barcode field, usually after a migration from another platform. If yours are in the barcode field, leave the default alone. The missing GTIN guide covers empty barcodes.

Method 1: Shopify's channel mapping

Shopify's channel mapping lets you choose the source for each field a sales channel receives.

  1. In the Shopify admin, go to Settings > Sales channels.
  2. Click Google & YouTube.
  3. In the Channel mapping section, click Edit mappings.
  4. Find the Google field, and choose a product field, a variant field or a metafield as its source.

What the documentation says it can do:

  • Text fields can take a combined value built from product data, metafields and text you type.
  • You can write the value in Liquid instead, with up to 10 sources and Liquid filters.
  • When the source you picked has no value for a product, the channel's default source is used.

And its limits:

  • "A channel field mapping applies to all of the products that you publish to that channel." You cannot set a different mapping for a product category.
  • Liquid tags such as if, for and assign are not allowed. Filters can change case or shorten text, but anything that needs a condition has to be fixed in the store data.
  • "Only sources with a data type that the field accepts are available." A list or reference metafield may not be offered for a text field.
  • A product field cannot use variant data, so a variant metafield is only offered for variant-level fields.
  • Shopify's page does not list which Google fields can be mapped. Check the mapping screen for custom_label_0 to custom_label_4 before you plan campaign labels around it.

Shopify says changes "can take some time to display on the channel" and gives no interval. Google then reviews the updated products, which it says can take 3-5 business days.

For a store whose metafields are complete and already hold Google's values, this is enough.

Method 2: a feed tool

A feed tool is worth it when the mapping has to differ by product group, when values need translating, or when you want errors reported before Google sees them. The usual building blocks are a lookup table and a fallback chain. A lookup for gender looks like this:

"Mens" -> "male"
"Womens" -> "female"
"Unisex Adults" -> "unisex"
"Kids" -> "unisex"   # Google's `gender` doesn't accept "kids"; pair with age_group instead

A fallback chain for color reads the metafield first, then the variant's Color option, then a default.

Check that the tool you pick reads variant metafields, since color, size and gtin live there. SnowPipe does not read Shopify metafields yet. It maps the standard fields and the variant options, where an option named Color, Colour or Size becomes color or size, and it has lookup tables and fallbacks for those. If your attributes are only in metafields today, use channel mapping, or a tool that lists variant metafields as a source.

Run one writer per Merchant Center account. The Google & YouTube app and a feed tool sending the same products can send conflicting data.

Value rules that get products rejected

A correct mapping still fails if the value is one Google does not accept.

gender: male, female, unisex

That is the whole list. Mens, Women's, Boys, Girls and Kids are not accepted. For children's products, pair male or female with age_group: kids.

age_group: newborn, infant, toddler, kids, adult

Google's age_group page defines each one: newborn is 0 to 3 months, infant 3 to 12 months, toddler 1 to 5 years, kids 5 to 13 years, and adult is 13 and older. Your own buckets, such as Kids 3-5 or Junior, are not valid.

color: slash-separated, same as the landing page

The color page allows up to 3 colors, 100 characters in total and 40 per color, written as Red/Green/Black. It also says to use the same color name as your landing page. If the page says "Midnight", send Midnight and put a standard color name in the title. Hex codes and single letters such as R are not accepted.

size: free text, plus size_system

size accepts XS, 38 or 7.5 as written on the product. For apparel you can add size_system (US, UK, EU, JP and others) and size_type (regular, petite, maternity, big, tall, plus). Both are optional.

material: the material itself

The material page takes a primary material and up to two secondary ones separated by a slash, such as Cotton/Polyester/Elastane. It says not to submit values that do not name a material, such as n/a, none, multi or other.

Common pitfalls

  • A list or reference type where text is expected. A list metafield is stored as a JSON array (["red", "blue"]) and a metaobject_reference is stored as an ID (gid://shopify/Metaobject/123). Neither is a color name. Use single_line_text_field for values you send to Google.
  • Color on the product instead of the variant. Every variant then carries the same color, and Google sees three "blue" variants with different photos.
  • Inconsistent casing and spacing from an import. Black, black and BLACK are three different values in a feed. Normalize them in Shopify before mapping.
  • Two namespaces holding the same attribute. If the same attribute is filled in under custom.* and under mm-google-shopping.* with different values, the one the mapping points at is the one Google gets.

When a mapped metafield still does not arrive, the troubleshooting guide goes through the causes in the order to check them.


Ready to stop fixing feed data by hand?

Try SnowPipe free: connect your Shopify store and sync an accurate feed to Google Merchant Center. Or book a 15-min demo and I'll walk you through your specific setup.

Ready to automate your product feeds?

Connect your store and sync to Google, Facebook, and more — in minutes. No credit card required.