

<div class="admonition admonition-important"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

When you select this feed type to [configure AI engine](/docs/settings/configuration/ai-engine-configuration), you can set grouping feed attributes on the interface.

</div></div></div>


An item feed is necessary to show items in search results, recommendations, to make propensity predictions, and so on.

One of the options of uploading an item feed is to use a Google Merchant Center XML file (RSS or Atom specification). Such a file can be:
- [uploaded to Catalogs](/use-cases/import-product-feed-to-catalog) with [Automation Hub](/docs/automation).  
    In this case, Data Transformation can be used to modify the content to meet the requirements. The catalog can then be used as an item feed (for example, for event enrichment or when [Configuring the AI engine](/docs/settings/configuration/ai-engine-configuration)).  
    See example Use Case: [Transform and import product data to a catalog](/use-cases/import-xml-file).
- pulled from an URL as the item feed when [Configuring the AI engine](/docs/settings/configuration/ai-engine-configuration).  
    In this case, the file must already meet the requirements when Synerise pulls it from the URL you provide.
    

  This article describes the requirements that the XML must meet, some good practices, and how to add custom attributes.


  <div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

  For a complete documentation of the Google Merchant Center XML format, see:
- [Google's guide on creating feed files](https://support.google.com/merchants/topic/2473799)
- [Google's list of item attributes](https://support.google.com/merchants/answer/6324469)

</div></div></div>



## Requirements

- The file must be written according to RSS or Atom specification.
- The file must meet the requirements listed in Google's documentation.
- The maximum file size is 5 GB (5 000 000 000 bytes).
- The encoding must be UTF-8.
- These two namespaces must be included in the XML prolog:
    ```
    xmlns:g="http://base.google.com/ns/1.0" xmlns:c="http://base.google.com/cns/1.0"
    ```
- Item attributes from the Google Merchant Center XML standard must have a `g:` prefix.  
   **Exceptions**: `title`, `link`, `description`, `name`
- The following attributes (tags) are required in every item:
    - `<g:id>`
    - `<title>`
    - `<g:availability>`
    - `<g:product_type>`  
        The value of the attribute is saved in Synerise as the item category and can be used, for example, in recommendations.
    - `<g:price>`
    - `<link>`
    - `<g:image_link>`
- `product:type` must be the same as the category on your website (in [OG tags](/developers/web/og-tags)).
- The item ID (`g:id` in the XML) must be consistent in every integration and piece of data you store in Synerise (transactions, page view events, item feed, and so on) 
- The item feed limit for [visual similarity](/docs/ai-hub/recommendations-v2/recommendation-types#visual-similarity) recommendation model is 1,000,000 items, regardless of the item feed type. 

If your XML is not built exactly according to Google's documentation (for example, `c:cost` is used instead of `g:price` and `g:price` is not included at all), you need to create an [workflow](/docs/automation/creating-automation) with data transformation while importing the data.

## Attribute name transfer into Synerise

Synerise automatically maps attributes (including custom attributes) from the XML to attributes in the Synerise database. The prefix is removed and `snake_case` is converted into `camelCase`. For example, `g:image_link` is saved as `imageLink`.  
Some attributes are transferred differently:
- `g:product_type` attribute is transformed into `category`
- `g:price`; `g:cost_of_goods_sold`; `g:sale_price` and custom attributes of `price` type are split into value and currency, and their names are converted into camelCase.  
    For example:  
    - `g:price = 12 USD` is saved as `price.value = 12` and `price.currency = USD`
    - `g:sale_price` is saved as `salePrice.value` and `salePrice.currency`
- `g:availability` is converted into boolean (true/false) values.
- Custom attributes are saved in the `attributes` object.  
    For example, `c:myAttribute` is saved as `attributes.myAttribute`. When using [Inserts in a recommendation frame](/developers/inserts/recommendations-v2), if the item info is stored in the `item` object, you need to access the custom attribute in the following way:  
    `{{item.attributes.myAttribute}}`
- Multiple instances of the same parameter will be saved as an array, for example:
    
  <pre><code class="language-LANG">&lt;c:purpose&gt;Regeneration&lt;/c:purpose&gt; 
  &lt;c:purpose&gt;Dry hair&lt;/c:purpose&gt; 
  &lt;c:purpose&gt;Colored hair&lt;/c:purpose&gt;</code></pre>

    are saved as:
    ```
    "attributes": {
        "purpose": ["Regeneration","Dry hair","Colored hair"]
    }
    ```

## Attributes created automatically

If `g:price` is defined, the following attributes may be created automatically while the XML is imported:
- `effectivePrice`  
    If `g:salePrice` is defined, it's saved as `effectivePrice`. If not, the value of `g:price` is used as `effectivePrice`
- `discountAmount`  
    This is `price.value` minus `salePrice.value`
- `discount`  
    This is `discountAmount` divided by `price.value`

## Attribute format

The attributes can be saved in two formats:
- By using the `CDATA` tag, for example:
    ```
    <g:product_type><![CDATA[ Man > all > clothes > shirts ]]></g:product_type>
    ```  
    This format lets you include special characters (`<, >, &`) in the attribute's value. This is the recommended format.
- As a string, for example:  
    ```
    <g:product_type>Man &gt; all &gt; clothes &gt; shirts</g:product_type>
    ```  
    In this format, special characters (`<, >, &`) can't be used.

### Category separators 
In both formats, there must be a space before and after the category separator (`>` or `&gt;`). Otherwise, the character is treated as part of the category name instead of a separator.

<strong style="color:green">Correct:</strong> `clothes > shirts`

<strong style="color:red">Wrong:</strong> `clothes>shirts`

## Custom item attributes 

Custom parameters are prefixed with a `c:`:

<pre><code class="language-xml">...
&lt;c:custom_tagName1&gt;...&lt;/c:custom_tagName1&gt;
&lt;c:custom_tagName2&gt;...&lt;/c:custom_tagName2&gt;
...</code></pre>


### Additional categories

If you want to add additional categories that are recognized by Synerise, use the `<g:additional_product_type>` attribute, for example:

<pre><code class="language-xml">&lt;g:additional_product_type&gt;&lt;![CDATA[X &gt; Y &gt; Z]]&gt;&lt;/g:additional_product_type&gt;
&lt;g:additional_product_type&gt;&lt;![CDATA[A &gt; B &gt; C]]&gt;&lt;/g:additional_product_type&gt;
&lt;g:additional_product_type&gt;&lt;![CDATA[1 &gt; 2 &gt; 3]]&gt;&lt;/g:additional_product_type&gt;</code></pre>


## Good practices
Tips to help you make your work easier and your files more efficient:

- Avoid including too large images. They may slow down loading dynamic content in campaigns where data from the feed is used.
- Use the `<[!CDATA]>` tag in case you add items with special characters (`<, >, &`) in the attribute in the future, even if the attributes don't include those characters now.
- Include only the attributes that you plan to use.
- Include the [Last-Modified](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified) header to enable detection of whether the product feed import is necessary, this will help you reduce data transmission costs.


## Troubleshooting
1. Ensure that all the [requirements](#requirements) are met.
2. For the most common problems, see the "Item feed" section of the [Integration checklist](/first-steps/integration/integration-review#item-feed).

## RSS example


<pre><code class="language-xml">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;rss version="2.0" xmlns:g="http://base.google.com/ns/1.0" xmlns:c="http://base.google.com/cns/1.0"&gt;
    &lt;channel&gt;
        &lt;title&gt;Your Website&lt;/title&gt;
        &lt;link&gt;http://www.example.com&lt;/link&gt;
        &lt;description&gt;About your website&lt;/description&gt;
        &lt;item&gt;

            &lt;!-- The following attributes are always required --&gt;
            &lt;g:id&gt;CLO-29473856-2&lt;/g:id&gt;
            &lt;title&gt;&lt;![CDATA[Roma Cotton Rich Bootcut Jeans - Size 8 Tall]]&gt;&lt;/title&gt;
            &lt;g:availability&gt;&lt;![CDATA[in stock]]&gt;&lt;/g:availability&gt;
            &lt;g:product_type&gt;&lt;![CDATA[Women's Clothing ? Jeans &gt; Bootcut Jeans]]&gt;&lt;/g:product_type&gt;
            &lt;g:price&gt;59.50 USD&lt;/g:price&gt;
            &lt;link&gt;&lt;![CDATA[http://www.example.com/clothing/women/Roma-Cotton-Bootcut-Jeans/?extid=CLO-29473856]]&gt;&lt;/link&gt;
            &lt;g:image_link&gt;&lt;![CDATA[http://images.example.com/CLO-29473856-front.jpg]]&gt;&lt;/g:image_link&gt;

            &lt;!-- The following demonstrates the use of the 'sale price' attribute --&gt;
            &lt;g:sale_price&gt;29.20 USD&lt;/g:sale_price&gt;

            &lt;!-- The following attributes are not required for this item --&gt;
            &lt;g:item_group_id&gt;CLO-29473856&lt;/g:item_group_id&gt;
            &lt;name&gt;&lt;![CDATA[Roma Cotton Rich Bootcut Jeans]]&gt;&lt;/name&gt;
            &lt;g:online_only&gt;yes&lt;/g:online_only&gt;
            &lt;description&gt;&lt;![CDATA[A smart pair of bootcut jeans in stretch cotton.]]&gt;&lt;/description&gt;
            &lt;g:condition&gt;new&lt;/g:condition&gt;
            &lt;g:size&gt;30&lt;/g:size&gt;
            &lt;g:quantity&gt;10&lt;/g:quantity&gt;
            &lt;g:color&gt;&lt;![CDATA[Navy]]&gt;&lt;/g:color&gt;
            &lt;g:shipping_weight&gt;1 kg&lt;/g:shipping_weight&gt;
            &lt;g:manufacturer&gt;&lt;![CDATA[Wonderful Jean]]&gt;&lt;/g:manufacturer&gt;
            &lt;g:brand&gt;&lt;![CDATA[MS]]&gt;&lt;/g:brand&gt;
            &lt;g:mpn&gt;B003J5F5EY&lt;/g:mpn&gt;
            &lt;g:gtin&gt;5060155240282&lt;/g:gtin&gt;
            &lt;g:google_product_category&gt;Women's Clothing &gt; Jeans &gt; Bootcut Jeans&lt;/g:google_product_category&gt;
            &lt;g:gender&gt;Female&lt;/g:gender&gt;
            &lt;g:material&gt;&lt;![CDATA[Jeans]]&gt;&lt;/g:material&gt;

            &lt;!-- The following demonstrates the use of the custom attributes --&gt;
            &lt;c:age_group&gt;&lt;![CDATA[Adult]]&gt;&lt;/c:age_group&gt;
        &lt;/item&gt;
        &lt;item&gt;...&lt;/item&gt;
        &lt;item&gt;...&lt;/item&gt;
&lt;/channel&gt;
&lt;/rss&gt;</code></pre>


## Atom example


<pre><code class="language-xml">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;feed xmlns:g="http://base.google.com/ns/1.0" xmlns:c="http://base.google.com/cns/1.0"&gt;
    &lt;title&gt;Your Website&lt;/title&gt;
    &lt;link rel="self" href="http://www.example.com" /&gt;
    &lt;updated&gt;2018-01-01CET10:10:30&lt;/updated&gt;
    &lt;entry&gt;

        &lt;!-- The following attributes are always required --&gt;
        &lt;g:id&gt;CLO-29473856-2&lt;/g:id&gt;
        &lt;title&gt;&lt;![CDATA[Roma Cotton Rich Bootcut Jeans - Size 8 Tall]]&gt;&lt;/title&gt;
        &lt;g:availability&gt;&lt;![CDATA[out of stock]]&gt;&lt;/g:availability&gt;
        &lt;g:product_type&gt;&lt;![CDATA[Women's Clothing ? Jeans &gt; Bootcut Jeans]]&gt;&lt;/g:product_type&gt;
        &lt;g:price&gt;59.50 USD&lt;/g:price&gt;
        &lt;link&gt;&lt;![CDATA[http://www.example.com/clothing/women/Roma-Cotton-Bootcut-Jeans/?extid=CLO-29473856]]&gt;&lt;/link&gt;
        &lt;g:image_link&gt;&lt;![CDATA[http://images.example.com/CLO-29473856-front.jpg]]&gt;&lt;/g:image_link&gt;

        &lt;!-- The following demonstrates the use of the 'sale price' attribute --&gt;
        &lt;g:sale_price&gt;29.20 USD&lt;/g:sale_price&gt;

        &lt;!-- The following attributes are not required for this item --&gt;
        &lt;g:item_group_id&gt;CLO-29473856&lt;/g:item_group_id&gt;
        &lt;name&gt;&lt;![CDATA[Roma Cotton Rich Bootcut Jeans]]&gt;&lt;/name&gt;
        &lt;g:online_only&gt;yes&lt;/g:online_only&gt;
        &lt;description&gt;&lt;![CDATA[A smart pair of bootcut jeans in stretch cotton.]]&gt;&lt;/description&gt;
        &lt;g:condition&gt;new&lt;/g:condition&gt;
        &lt;g:size&gt;30&lt;/g:size&gt;
        &lt;g:quantity&gt;10&lt;/g:quantity&gt;
        &lt;g:color&gt;&lt;![CDATA[Navy]]&gt;&lt;/g:color&gt;
        &lt;g:shipping_weight&gt;1 kg&lt;/g:shipping_weight&gt;
        &lt;g:manufacturer&gt;&lt;![CDATA[Wonderful Jean]]&gt;&lt;/g:manufacturer&gt;
        &lt;g:brand&gt;&lt;![CDATA[MS]]&gt;&lt;/g:brand&gt;
        &lt;g:mpn&gt;B003J5F5EY&lt;/g:mpn&gt;
        &lt;g:gtin&gt;5060155240282&lt;/g:gtin&gt;
        &lt;g:google_product_category&gt;Women's Clothing &amp;gt; Jeans &amp;gt; Bootcut Jeans&lt;/g:google_product_category&gt;
        &lt;g:gender&gt;Female&lt;/g:gender&gt;
        &lt;g:material&gt;&lt;![CDATA[Jeans]]&gt;&lt;/g:material&gt;
        &lt;g:additional_image_link&gt;http://images.example.com/CLO-29473856-side.jpg&lt;/g:additional_image_link&gt;
        &lt;g:additional_image_link&gt;http://images.example.com/CLO-29473856-back.jpg&lt;/g:additional_image_link&gt;
        &lt;g:shipping&gt;
            &lt;g:country&gt;US&lt;/g:country&gt;
            &lt;g:service&gt;Standard Free Shipping&lt;/g:service&gt;
            &lt;g:price&gt;0 USD&lt;/g:price&gt;
        &lt;/g:shipping&gt;

        &lt;!-- The following demonstrates the use of the custom attributes --&gt;
        &lt;c:age_group&gt;&lt;![CDATA[Adult]]&gt;&lt;/c:age_group&gt;
    &lt;/entry&gt;
    &lt;entry&gt;...&lt;/entry&gt;
    &lt;entry&gt;...&lt;/entry&gt;
&lt;/feed&gt;</code></pre>
