Skip to content

Google Merchant product feeds

google-merchant-product-feeds

Build a Google Merchant Center product feed item with the required id, title, description, link, image, availability, and price fields. Use when exporting products to Merchant Center, Content API items, or a product feed file.

Version 0.3.2  ·  MIT  ·  Source  ·  Rule

Install this skill

Copy the skill and its rule into your project:

npx @sadrmanesh/commerce-agent-skills add google-merchant-product-feeds

The skill goes to .agents/skills/ and the rule to .agents/rules/. See Command line for other directories.

Use this skill when a catalog becomes a Merchant Center item. On-page JSON-LD is the structured-data skill. Generated titles and descriptions follow the description-guardrails skill, then the structured-title rules below.

Attribute names and limits below follow Google's Merchant Center product data specification. Re-check that specification when a disapproval cites an attribute this skill does not list. The local checker does not call Google.

Procedure

  1. Emit one item per purchasable unit. A variant gets its own id. Variants that shoppers choose among share item_group_id.
  2. Fill the required attributes: id, title or structured_title, description or structured_description, link, image_link, availability, and price.
  3. Match the landing page. The title, description, price, and availability a shopper sees are the values in the feed.
  4. Run node scripts/check-feed-item.mjs --file item.json from this skill directory.
  5. Keep id stable for the life of that unit. A new id on every export creates a new product and drops history.

Field limits and the variant rules are in the attribute notes. An item that passes the checker is in assets/example-item.json. Worked examples and checks are in evals/tasks.json.

Required values

Attribute Rule
id Unique, stable, at most 50 characters. Use the SKU when the SKU fits.
title Plain text, at most 150 characters, or structured_title when the title was generated.
description Plain text, at most 5000 characters, or structured_description when the description was generated.
link http or https URL of the product landing page on the verified domain.
image_link http or https URL of the main product image.
availability in_stock, out_of_stock, preorder, or backorder.
price Decimal major units with a period, a space, and an ISO 4217 code, such as 15.00 USD.

availability_date is required when availability is preorder. Provide it for backorder as well. The product data specification asks for that date on both.

Variants

Set item_group_id to the parent id for every variant. Google's specification marks item_group_id as required for variants in free listings, and for variants targeted at Brazil, France, Germany, Japan, the United Kingdom, and the United States. Put the variant's color or size in color and size when those attributes distinguish the unit. Apparel in those countries has extra required attributes (color, size, gender, age_group). Do not guess them. Read them from the catalog or leave the item out of the feed until they exist.

Generated text

If a title or description was produced by a generative system, do not put it only in title or description. Use structured_title or structured_description and set digital_source_type to trained_algorithmic_media. The ordinary title and description attributes are for text that was not created that way. The content still has to match the landing page and stay within 150 and 5000 characters.

Images

Merchant Center has announced a minimum image size of 500 by 500 pixels, with enforcement beginning 31 January 2027. Export images that already meet that size instead of waiting for the disapproval. The checker validates the URL, not the pixel size. Check dimensions in the image pipeline.

Gotchas

  • A formatted price such as $15.00 or 15,00 USD is not the price attribute. Use 15.00 USD.
  • Changing id when the SKU gains a prefix splits the product in Merchant Center.
  • Out-of-stock items still need a price, and the landing page still needs to show that price.
  • Do not put "free shipping" or a competitor name in title or description.
  • GTIN is not universally required. Submit a real GTIN when the product has one. Do not invent digits. identifier_exists is the attribute Google documents when you do not have a GTIN; confirm the current rule for that category before setting it false.

Verification

  • The checker exits 0 on the feed file.
  • Each variant id is unique and stable, and shares item_group_id with its siblings.
  • A spot-check opens link and sees the same price text and availability.
  • A generated description is in structured_description, not only in description.

Evaluation

Worked examples and the checks they must satisfy are in evals/tasks.json.

References

Merchant Center item attributes

Source: Google Merchant Center product data specification. Limits below are the ones that specification states for the common required attributes.

Identity

  • id: at most 50 characters, unique per product, stable across updates, same id for the same product across countries or languages when it is the same unit.
  • item_group_id: shared by variants. Required for variant free listings, and for variants in Brazil, France, Germany, Japan, the United Kingdom, and the United States.
  • gtin: submit only a real GTIN. The specification strongly recommends it when one exists. Maximum 50 numeric characters, at most 14 digits per value, ignoring added spaces and dashes.

Text

  • title: at most 150 characters. No promotional text such as "free shipping", and no all-capital slogans.
  • description: at most 5000 characters. Product information only. No store links, sale copy, or other products.
  • Generated text uses structured_title or structured_description. Set digital_source_type to trained_algorithmic_media and put the words in content. default means the text was not generated. If you omit digital_source_type, Google treats it as default.

Offer

  • price: 19.00 USD. Period as the decimal separator. ISO 4217 currency code.
  • sale_price: same format, lower than price, and only while the landing page shows that sale.
  • availability: in_stock, out_of_stock, preorder, backorder.
  • availability_date: required for preorder. Also send it for backorder.
  • link and image_link: absolute http or https URLs. link is the landing page on the verified domain, not an interstitial.

Condition

condition is required when the product is used or refurbished. Allowed values are new, refurbished, and used. Do not omit new on a new product if the target program asks for it; check the current specification for that program rather than guessing.

Checker

scripts/check-feed-item.mjs checks one JSON object:

  • required keys id, title or structured title content, description or structured description content, link, image_link, availability, price
  • length limits for id, title, and description
  • price pattern and availability vocabulary
  • availability_date when availability is preorder or backorder
  • https or http URLs

It does not upload the item, fetch the image, or know whether a category needs color or gender.

Evaluation

Fixtures from evals/tasks.json. See evaluation fixtures for how the checks work.

stable-variant-id

Export the blue shirt variant to Merchant Center with a stable id, a grouped parent, and a decimal price.

Must include: item_group_id, 19.00 USD

Must not include: $19.00

Worked example

One feed item for the purchasable color.

id is SHIRT-BLUE, item_group_id is shirt, availability is in_stock, and price is 19.00 USD. The link opens that variant.

generated-title

Label a generated product title so Merchant Center can tell it from a title a person wrote.

Must include: trained_algorithmic_media, structured_title

Must not include: free shipping

Worked example

Put the generated words in structured_title.

Set digital_source_type to trained_algorithmic_media and keep the content within 150 characters. Do not add promotional text.