Google Shopping XML feed example, with every required field
Below is a complete Google Shopping XML feed you can copy: two products, each with every required field. Every item carries id, title, description, link, image_link, availability and price, plus brand and an MPN, because most new products need a brand and those without a GTIN need an MPN. The apparel item adds color, size, gender, age_group and item_group_id. The file is RSS 2.0 with xmlns:g="http://base.google.com/ns/1.0" declared and the g: prefix on every product attribute. google_product_category is optional; the example sends the numeric ID, which Google recommends.
What this comes down to
- The feed is RSS 2.0 with xmlns:g="http://base.google.com/ns/1.0" declared, and every product attribute carries the g: prefix.
- Seven attributes are required on every item: id, title, description, link, image_link, availability and price.
- Brand is required for most new products, and an MPN is required when the product has no manufacturer GTIN.
- google_product_category is optional; Google recommends the numeric ID, which also avoids escaping ampersands.
A complete example
Two products, one with a variant group, with every field this guide discusses:
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
<channel>
<title>Northline Home</title>
<link>https://example.com</link>
<description>Northline Home product feed</description>
<item>
<g:id>MUG-350-BLUE</g:id>
<g:title>Northline ceramic mug, 350 mL, blue</g:title>
<g:description>Dishwasher-safe glazed ceramic mug with a handle.</g:description>
<g:link>https://example.com/products/mug-blue</g:link>
<g:image_link>https://example.com/images/mug-blue.jpg</g:image_link>
<g:availability>in_stock</g:availability>
<g:price>18.00 USD</g:price>
<g:brand>Northline</g:brand>
<g:mpn>NL-MUG-350-BL</g:mpn>
<g:google_product_category>2169</g:google_product_category>
<g:product_type>Kitchen > Mugs & Cups</g:product_type>
</item>
<item>
<g:id>DRESS-LIN-S-GRN</g:id>
<g:item_group_id>DRESS-LIN</g:item_group_id>
<g:title>Northline linen dress, green, size S</g:title>
<g:description>Midi-length linen dress with side pockets.</g:description>
<g:link>https://example.com/products/linen-dress?size=S&color=green</g:link>
<g:image_link>https://example.com/images/linen-dress-green.jpg</g:image_link>
<g:availability>in_stock</g:availability>
<g:price>89.00 USD</g:price>
<g:sale_price>69.00 USD</g:sale_price>
<g:brand>Northline</g:brand>
<g:mpn>NL-DRS-LIN-S-GRN</g:mpn>
<g:google_product_category>2271</g:google_product_category>
<g:color>Green</g:color>
<g:size>S</g:size>
<g:gender>female</g:gender>
<g:age_group>adult</g:age_group>
</item>
</channel>
</rss>The URLs, brand and part numbers are placeholders. Neither product has a GTIN here because an invented barcode is worse than none; if your products have real GTINs, add <g:gtin> with the barcode number.
The wrapper: rss, channel and the namespace
The file is ordinary RSS 2.0. What makes it a Merchant Center feed is the namespace declaration on the rss element, xmlns:g="http://base.google.com/ns/1.0", and the g: prefix on every product attribute. Without the prefix, a tag like <price> is not a Google attribute.
The channel carries a title, link and description, which describe the feed, not a product. Save the file with the .xml extension, and register it in Merchant Center under the same file name it is published with.
Which fields are required
| Attribute | Required |
|---|---|
id, title, description, link, image_link, availability, price | Always |
brand | For all new products, except movies, books and musical recordings |
gtin | Depends; strongly recommended when the product has one |
mpn | Only when the product has no manufacturer GTIN |
condition | When the product is used or refurbished |
item_group_id | For variants, in the countries Google lists |
color, size, gender, age_group | For apparel, in the countries Google lists |
availability_date | When availability is preorder |
google_product_category | Optional |
The apparel and variant rows are why the dress carries more fields than the mug. The full list of countries is in Google’s product data specification; the GTIN, MPN and SKU guide explains which identifier is which.
Escaping: the error that breaks the whole file
XML treats & and < as markup. A raw ampersand anywhere, in a title, a description or a URL with two query parameters, makes the file invalid XML, and a file that does not parse cannot be processed. Write them as & and <, as the dress link above does.
This is a practical reason to send google_product_category as the ID. The path for the mug is Home & Garden > Kitchen & Dining > Tableware > Drinkware > Mugs, with two ampersands to escape; the ID is 2169, with none. Google recommends the ID anyway. The ID or path guide covers the other reasons.
Filling google_product_category for every item
For a handful of products, the Category Finder gives the ID for one title at a time, and the taxonomy download has the whole list as CSV or Excel to filter by hand. For a catalog, the Bulk Mapper returns an ID for every row, which you can merge into the feed or send as a supplemental data source without touching the XML at all.
XML is not the only option. Merchant Center also reads tab-separated text and Google Sheets; the feed format guide compares them.
Questions
What namespace does a Google Shopping XML feed use?
xmlns:g="http://base.google.com/ns/1.0", declared on the rss element. Every product attribute then carries the g: prefix, for example <g:price>.
Is google_product_category required in an XML feed?
No. Google lists it as optional and assigns a category automatically. When you send it, Google recommends the numeric category ID over the full path.
Why is my XML feed not being read?
The most common cause is a file that is not valid XML, usually a raw & in a title, description or URL. Escape it as &. Also check that the g namespace is declared and that the registered file name matches the published one.
Do I need a GTIN in the feed?
Google calls GTIN strongly recommended when the product has one. If the product has no manufacturer GTIN, send an MPN with the brand instead. Do not invent a barcode.
Read next
Which product feed format should you use for Google Merchant Center?
App sync, Google Sheets, tab-delimited text or XML: which Merchant Center feed format fits your catalog, what Google lists, and three spreadsheet traps.
Google product category: use the ID or the full path?
Google accepts either the numeric ID or the full category path, not both. Why the ID is the safer choice, and how Microsoft treats each.
GTIN, MPN and SKU: whose number is each, and who may create it
The GTIN and MPN belong to the manufacturer, the SKU belongs to you. Which ones you may create, where each goes in a Google feed, and when to set none.