When uploading product feeds on Facebook, there are various file format options to choose from—CSV, TSV, Excel (XLSX), Google Sheets, and XML (RSS or ATOM). Each format has its own purpose depending on the complexity and size of your product catalog.

CSV and TSV files are great for simple, smaller catalogs. They’re easy to create and are ideal for merchants with a limited product range. However, these formats fall short when dealing with more intricate product data such as variants, rich attributes, or frequent updates.

XML is the most suitable format if your catalog is extensive, detailed, or needs to be updated automatically. It is ideal for representing complex product relationships and metadata, while aligning with Facebook product feed specifications. 

However, creating an XML feed is different from generating a CSV file. It is challenging, but it is completely doable with a solid understanding of XML structure and Facebook’s schema expectations.

In this blog, we’ll walk you through everything you need to know to create an XML product feed for Facebook. You’ll learn the fundamentals of XML structure, see a real example of a Facebook-ready XML feed, and discover how to customize it based on your needs.

Let’s dive in! 

Understanding Facebook Product Feed 

Facebook XML product feed is a structured file, containing all the necessary product details such as ID, title, description, brand, etc. 

Facebook has some specifications for an XML product feed to publish your products. In this section, let’s look at the structure of an XML product feed. 

XML Feed Structure

For demonstration purposes, let’s consider we have a clothing store known as natasha. Our website is ‘https://natasha.com’  and we want to promote our products on Facebook. natasha has a huge product catalog with multiple variants and so on. Therefore, we decided to create an XML product feed for natasha. 

1. XML Declaration

Every XML file starts with a declaration that defines the version and encoding. It is as follows:

<?xml version=”1.0″ encoding=”UTF-8″?>

2. Root Node

The next line in the XML feed is RSS. The root element <rss> contains the entire feed. It includes attributes specifying the version and namespaces:

<rss version=”2.0″

     xmlns:g=”http://base.google.com/ns/1.0&#8243;

     xmlns:atom=”http://www.w3.org/2005/Atom”&gt;

  • version: Specifies the RSS version.
  • xmlns:g: Defines the namespace for Google product attributes.
  • xmlns:atom: Defines the namespace for Atom elements.

3. Channel Node

Within <rss>, the <channel> element provides metadata about your feed:

<channel>

  <title>natasha</title>

  <link>https://www.natasha.com</link&gt;

  <description>Product feed for Facebook catalog</description>

  …

</channel>

  • <title>: The name of your store.
  • <link>: The URL to your store’s homepage.
  • <description>: A brief description of the feed.

4. Item Node

Each product is represented by an <item> element within the <channel>. Inside each <item>, use <g:> prefixed tags to define product attributes.

The prefix ‘g:’ in a Facebook XML product feed represents attributes belonging to the Google Merchant Center namespace. 
Facebook uses this namespace to understand which attributes in your feed are specifically intended for Google’s product data requirements, even when used within a Facebook product feed.
Attributes like <g:id>, <g:availability>, and <g:price> are examples of fields that use this prefix. They are part of the Google Merchant Center specification.

<item>

      <g:id>SKU12345</g:id>

      <g:title>Men’s Blue Denim Jeans</g:title>

      <g:description>Comfortable men’s blue denim jeans made from 100%    cotton.</g:description>

<g:link>https://www.yourstore.com/product/sku12345</g:link&gt;

<g:image_link>https://www.natasha.com/images/sku12345.jpg</g:image_link&gt;

      <g:availability>in stock</g:availability>

      <g:condition>new</g:condition>

      <g:price>49.99 USD</g:price>

      <g:brand>natasha</g:brand>

 </item>

Note: Each line in the XML feed has a size limit of 5 MB.

The code above lists a few required attributes. In the following section, we will examine each one in detail.

Facebook XML Product Feed Attributes

This section will discuss Facebook product feed specifications, along with required and optional fields for Facebook.  

Required Attributes

The following table lists all the required attributes in a Facebook product feed.

AttributeTagDescription (Format & Example)
ID<g:id>Unique product identifier. 
Format: Alphanumeric string (max 100 chars).
Example: SKU12345
Title<g:title>Product name in title case. 
Format: Text, up to 150 characters (Facebook recommends ≤65). 
Example: Stylish Cotton T-Shirt
Description<g:description>Plain text description. 
Format: Up to 5,000–9,999 characters. 
Example: A breathable cotton t-shirt perfect for casual wear.
Link<g:link>Product landing page URL. 
Format: Valid HTTPS URL. 
Example: https://natasha.com/products/tshirt-blue
Image Link<g:image_link>Main product image URL. 
Format: HTTPS image link (JPG, PNG, etc.). 
Example: https://natasha.com/images/tshirt-blue.jpg
Availability<g:availability>Current stock status. 
Supported values: in stock, out of stock, preorder. Example: in stock
Condition<g:condition>Item’s physical condition. 
Supported values: new, refurbished, used. 
Example: new
Price<g:price>Product price with currency. 
Format: number currency (ISO 4217). 
Example: 19.99 USD
Brand / MPN / GTIN<g:brand>, <g:mpn>, <g:gtin>At least one is required. 
Brand: Manufacturer name, Example: Natasha 
MPN: Manufacturer Part Number
Example: MPN12345
GTIN: Barcode (UPC, EAN, ISBN)
Example: 0123456789012

Important: GTIN, MPN, and Brand are optional attributes in the Facebook product catalog. However, at least one is highly recommended to improve product visibility and ad performance.

Optional Attributes

The following table contains all the optional attributes in a Facebook product feed.

FieldTagDescription (Format & Example)
sale_price<g:sale_price>Discounted price of the item. Format: 5.99 USD.
sale_price_effective_date<g:sale_price_effective_date>Timeframe for sale pricing. Format: YYYY-MM-DDTHH:MM±HH:MM/YYYY-MM-DDTHH:MM±HH:MM. Example: 2020-04-30T09:30-08:00/2020-05-30T23:59-08:00.
item_group_id<g:item_group_id>This field groups product variants.
Example: Trousers_1.
status<g:status>Visibility of product.
Example: active.
additional_image_link<g:additional_image_link>Extra product image URLs (up to 20).
Example: http://natasha.com/image1.jpg.
gtin<g:gtin>Global Trade Item Number. Example: 4011200296908.
mpn<g:mpn>Manufacturer Part Number. Format: Alphanumeric. Example: JAS12345PER.
google_product_category<g:google_product_category>Google taxonomy category. Example: Apparel & Accessories > Clothing or 212.
fb_product_category<g:fb_product_category>Facebook taxonomy category.
Example: Women’s Clothing > Tops & T-Shirts or 430.
color<g:color>Main color of the item. Format: Text. Example: Royal blue.
gender<g:gender>Target audience gender. Format: female, male, unisex. Example: female.
size<g:size>Size of the item. Format: Text or number. Example: Medium.
age_group<g:age_group>Target age category. Format: adult, teen, etc. Example: adult.
material<g:material>Material of the item. Format: Text. Example: Organic cotton.
pattern<g:pattern>Pattern or graphic print. Format: Text. Example: Stripes.
rich_text_description<g:rich_text_description>HTML-formatted product description. Format: HTML tags. Example: <p>Soft cotton tee</p>.
video[0].url to video[19].url<g:video_link>Links to product videos. Example: http://natasha.com/video.mp4.
shipping<g:shipping>Shipping region, method, and cost.
Example: US:NY:Ground:9.99 USD.
shipping_weight<g:shipping_weight>Delivery weight of the item.
Example: 0.3 kg, 10 lb.
internal_label<g:internal_label>Internal labels for filtering. Example: [‘summer’,’trending’].
custom_label_0 to custom_label_4<g:custom_label_0> – <g:custom_label_4>Custom labels for ads.
Example: Summer Sale.
custom_number_0 to custom_number_4<g:custom_number_0> – <g:custom_number_4>Numeric filter fields. Example: 2025.

Common Mistakes to Avoid

Below are a few Facebook common product feed mistakes to be aware of while creating the XML feed:

  1. Pay close attention to XML structure and tag names. A missing closing tag, incorrect nesting, or misnamed attribute (For example, <title> instead of <g:title>) will cause the entire feed or portions of it to be rejected.
  2. You might face recognition issues if you fail to include the correct XML namespaces (xmlns:g for Google attributes). Always include:
    xmlns:g=”http://base.google.com/ns/1.0&#8243;
  3. Unescaped characters like &, <, or > inside elements can break XML parsing. Always encode them as &amp;, &lt;, and &gt;.
  4. Facebook enforces a 5 MB size limit per line in the XML. Avoid long, uncompressed <g:rich_text_description> or long CDATA blocks without line breaks.
  5. Do not miss out on required attributes like <g:price>, <g:brand>, or <g:availability>. If so, it can cause disapproval or partial ingestion of the feed.
  6. Ensure <g:link> and <g:image_link> must be live, public, and start with http://, https://, ftp://, or sftp://.
  7. Prices must follow the number + space + ISO currency code format (e.g., 59.99 USD). 
  8. Facebook treats sku123 and SKU123 as different. If you try to reuse IDs interchanging the upper/lower case, it creates duplication and overwriting issues.
  9. Do not use ALL CAPS in <g:title> or <g:description>.
  10. Use <g:item_group_id> to group variants such as size and colors. If not, Facebook may treat them as unrelated products, leading to a disorganized catalog.

Facebook XML Product Feed Example

Here’s an example of how an XML product feed would look for natasha when you add all the required and optional fields.

<?xml version=”1.0″ encoding=”UTF-8″?>

<rss version=”2.0″ xmlns:g=”http://base.google.com/ns/1.0″&gt;

  <channel>

    <title>natasha</title>

    <link>https://www.natasha.com</link&gt;

    <description>Comprehensive product feed for Facebook Catalog</description>

    <item>

      <g:id>SKU12345</g:id>

      <g:title>Men’s Blue Denim Jeans</g:title>

      <g:description>Classic fit men’s blue denim jeans made from 100% cotton for comfort and durability.</g:description>     <g:link>https://www.natasha.com/products/sku12345</g:link>&nbsp; <g:image_link>https://www.natasha.com/images/sku12345_main.jpg</g:image_link&gt;

<g:additional_image_link>https://www.natasha.com/images/sku12345_side.jpg</g:additional_image_link&gt;

 <g:additional_image_link>https://www.natasha.com/images/sku12345_back.jpg</g:additional_image_link&gt;

      <g:availability>in stock</g:availability>

      <g:condition>new</g:condition>

      <g:price>59.99 USD</g:price>

      <g:sale_price>49.99 USD</g:sale_price>

      <g:sale_price_effective_date>2025-07-01T00:00:00Z/2025-07-07T23:59:59Z</g:sale_price_effective_date>

      <g:brand>Levi’s</g:brand>

      <g:gtin>00012345600012</g:gtin>

      <g:mpn>MPN12345</g:mpn>

      <g:google_product_category>Apparel > Accessories > Clothing > Jeans</g:google_product_category>

      <g:product_type>Men > Clothing > Jeans</g:product_type>

      <g:item_group_id>GROUP123</g:item_group_id>

      <g:color>Blue</g:color>

      <g:size>32</g:size>

      <g:gender>male</g:gender>

      <g:age_group>adult</g:age_group>

      <g:material>Cotton</g:material>

      <g:pattern>Solid</g:pattern>

      <g:shipping_weight>1.2 kg</g:shipping_weight>

      <g:custom_label_0>Summer Collection</g:custom_label_0>

      <g:custom_label_1>Best Seller</g:custom_label_1>

      <g:custom_label_2>High Margin</g:custom_label_2>

      <g:custom_label_3>Clearance</g:custom_label_3>

      <g:custom_label_4>Online Exclusive</g:custom_label_4>

      <g:custom_number_0>100</g:custom_number_0>

      <g:custom_number_1>2025</g:custom_number_1>

      <g:custom_number_2>50</g:custom_number_2>

      <g:custom_number_3>10</g:custom_number_3>

      <g:custom_number_4>5</g:custom_number_4>

      <g:video_link>https://www.natasha.com/videos/sku12345.mp4</g:video_link&gt;

      <g:rich_text_description><![CDATA[

        <p><strong>Features:</strong></p>

        <ul>

          <li>100% cotton denim</li>

          <li>Classic fit with straight leg</li>

          <li>Five-pocket styling</li>

          <li>Machine washable</li>

        </ul>

        <p>Perfect for everyday wear, these jeans offer both style and comfort.</p>

      ]]></g:rich_text_description>

    </item>

  </channel>

</rss>

As you go through the XML example feed for natasha, you will notice it follows a structure and lists detailed information about a product, such as rich_text_description, custom_label, and so on. 

If you’re an e-commerce merchant struggling to create XML feed, use this example as a template and build your own XML file without the help of any tools or automation. 

Customizing the Feed to Fit Facebook Specifications

You don’t have to start creating the feed again to align it with Facebook’s specifications. Follow the simple steps below:

Step 1: Understanding Facebook’s Feed Requirements

Know that you must include all the required attributes, such as,

  • id
  • title
  • description
  • link
  • image_link
  • availability
  • price
  • brand
  • condition

Step 2: Structure Your XML Feed

Refer to the XML feed example section, ensure your XML feed follows the structure.

Ensure that each <item> block represents a single product, and all required fields are populated accurately.

Step 3: Customize and Enhance Your Feed

  • Include Custom Labels: Use <g:custom_label_0> to <g:custom_label_4> for internal categorization, like seasonal promotions or clearance items.
  • Handle Product Variants: Use <g:item_group_id> to group product variants (e.g., different sizes or colors).
  • Add Sale Information: Include <g:sale_price> and <g:sale_price_effective_date> to highlight discounts.
  • Use High-Quality Images: Ensure images meet Facebook’s requirements (minimum 500×500 pixels, preferably 1024×1024 pixels, in JPEG or PNG format).
  • Map Categories: Align your product categories with Facebook’s taxonomy using <g:google_product_category>.
Important: You can validate your feed using online tools such as OptiFeed Feed Analyzer and FeedValidate.Enter the feed URL in any of the tools to identify errors and optimize Facebook product feed.

How to Upload Products With Facebook XML Feed 

Preparing Your XML Feed for Upload

  • Use a Compatible Format: Ensure your XML feed adheres to the RSS 2.0 standard and includes the appropriate namespaces, such as xmlns:g=”http://base.google.com/ns/1.0&#8243;.
  • Include Required Fields: Each product item in your feed should contain essential fields like <g:id>, <g:title>, <g:description>, <g:link>, <g:image_link>, <g:availability>, and <g:price>, including identifiers like <g:brand> and <g:mpn>.
  • Utilize Feed Generation Tools: If you’re a Shopify merchant, platforms like AdNabu offer tools to create and manage XML feeds tailored for Facebook Catalogs. These tools allow you to select products, map attributes, and format the feed according to Facebook’s specifications. After generating the XML feed, host the file on a publicly available URL with the help of your website server. And keep the URL ready when uploading it to Commerce Manager.
Further Reading: Top 6 Shopify Facebook product feed apps

Instantly Generate Product Feeds for Facebook Using AdNabu

Generate optimized data feed URLs for Facebook --

direct from Shopify.

Create, manage and customize each URL to fit Facebook product feed specifications.

Upload Facebook XML Product Feed

You can upload a product feed XML file by creating a URL or uploading it via your computer. Let’s look at how to upload it via URL.

Step 1: Log in to your Facebook Business account and navigate to the Commerce Manager.

Step 2: Click on ‘Add products’ to create a catalogue.

add products to facebook catalogue

Step 3: In the following screen, choose the appropriate option for the catalogue type. We are going with online products as Natasha is an online clothing store. 

choose online products option

Step 4: Add your business portfolio, add a name to the catalogue, and click ‘Next.’

fill in details about your business store

Step 5: In this step, you will have two options. 

  • Connect to a data feed (use this option to upload a file)
  • Manually add your products (use this option to add one product after the other manually)

Select the connect data feed option to upload your XML file and click ‘Next.’

select connect to a data feed

Step 6: In the next step, Facebook will ask you to select ‘Commerce Manager’ or ‘Google Merchant Center’ based on the file format. You can choose ‘Commerce Manager’ if the file is formatted according to Facebook specifications or Google Merchant Center if it is formatted according to Google Merchant Center specifications. The XML example we created was customized according to Facebook specifications. Hence, we will select Commerce Manager.

Step 7: Enter the XML product feed URL and click ‘Next.’

Note: The URL must begin with http://, https://, ftp://, or sftp:// and link to your file, not your website or Facebook page.

select the correct platform and enter feed URL

Step 8: Confirm the URL and currency on the following screen and set a data feed schedule. You can put it hourly, daily, or weekly. Then click ‘Upload.’

Step 9: After uploading, you will see the items that were successfully uploaded and those that were not uploaded, along with the reason for failure. Fix the issue in the feed file and upload it again to resolve it.

Step 10: We have successfully uploaded your Facebook XML product feed file and added a catalogue to your Facebook Commerce Manager. 

Looking for a Facebook Feed Management App? AdNabu Got You Covered!

Automatically create and sync Facebook feed from your Shopify store in real-time!

Best Practices for Facebook XML Product Feeds

  1. Use the RSS 2.0 standard and ensure the XML feed starts with proper declarations: <?xml version=”1.0″ encoding=”UTF-8″?>
  2. Always include required attributes, they are: <g:id>, <g:title>, <g:description>, <g:link>, <g:image_link>, <g:availability>, <g:condition>, <g:price>, and <g:brand>.
  3. Use CDATA for descriptions containing HTML. Which means, to include HTML formatting in rich descriptions, follow the format, <g:rich_text_description><![CDATA[ <p>Great cotton jeans for summer</p>]]></g:rich_text_description>
  4. Pair <g:sale_price> with <g:sale_price_effective_date> to control limited-time promotions.
  5. Use <g:item_group_id> to group variants and include color, size, material, and pattern for each variation.
  6. Use JPEG or PNG formats, ≥500×500 px (ideally 1024×1024). Include <g:additional_image_link> for secondary angles or lifestyle shots.
  7. Attributes like <g:google_product_category>, <g:fb_product_category>, <g:gtin>, <g:mpn>, and <g:video_link> boost visibility and catalog richness.
  8. <g:internal_label> and <g:custom_label_0-4> are powerful for campaign segmentation and product set filtering in Commerce Manager.
  9. Use tools like OptiFeed Feed Analyzer, FeedValidator.org, or Facebook’s Commerce Manager debugger to catch XML syntax and data issues early.

Host your XML on a public URL and schedule automatic daily or weekly updates to reflect price, stock, or new products.

Conclusion

This guide provides an overview of the XML feed structure, required and optional attributes, common mistakes to avoid, and best practices for creating an XML feed and adding a Facebook catalogue. Key takeaways include:

  • To structure an XML feed, begin with the XML declaration, define the <rss> and <channel> elements, including necessary namespaces, and store metadata.
  • Each <item> should contain required fields such as <g:id>, <g:title>, <g:description>, <g:link>, <g:image_link>, <g:availability>, <g:condition>, <g:price>, and at least one of <g:brand>, <g:mpn>, or <g:gtin>.
  • Incorporate optional fields like <g:sale_price>, <g:additional_image_link>, <g:size>, <g:item_group_id>  and more to provide more detailed product information.
  • Ensure you include all the required fields and format them correctly per Facebook’s guidelines. Use valid URLs for product and image links, maintain consistent and unique product IDs, and adhere to proper price formatting. Avoid using all uppercase letters in titles and descriptions.
  • Regularly update your feed to reflect current inventory and pricing. Utilize feed management tools to automate feed generation and scheduling. Validate your feed using Facebook’s Commerce Manager to identify and resolve any issues. 

FAQs

How do I create a Facebook XML product feed file from scratch for my e-commerce store?

Understanding the structure of an XML file plays a vital role in creating the XML feed. To avoid disapprovals, understand key node tags and attributes and their format, and adhere to Facebook product feed specifications.

How can I automate the generation of a Facebook XML product feed for a large inventory?

You can use product feed generation and automation tools that integrate with your e-commerce platform to regularly update and generate your XML feed. For Shopify merchants, some recommendations include tools such as Flexify and Awesome Product Feed.

How do I include product variants in my Facebook XML product feed?

To include product variants in your Facebook XML product feed, you must use the item_group_id field to group the variants and a unique ID for each variant. Additionally, you’ll need to specify the variant attributes like size, color, etc., using relevant fields. 

How do I handle out-of-stock products in my Facebook XML product feed?

Set the availability field to “out of stock,” and if you’re using the Facebook or Instagram checkout method, ensure the quantity_to_sell_on_facebook field is set to 0.

How do I test changes to my Facebook XML product feed before going live?

Make changes to your XML feed and upload a test feed using Facebook’s Catalog Manager. Verify that all data is processed and displayed correctly.

Check Out These Related Articles:

Author

Shanthi has over 2 years of experience in writing and has produced content for SaaS and Healthcare industries. She focuses on writing customer-centric and in-depth blogs for Shopify Merchants. Apart from writing, she enjoys a little dance and Netflix.

Write A Comment