Product feeds
A feed turns your store's products into a file (XML, CSV or JSON) with the structure a marketplace, a price comparison site or a marketing tool expects. Feeds are generated every night (00:00 CET) and published on a CDN.
There is a file for every active language of the store and for every country of the feed (global when the feed has no country), at a public address:
https://cdn.webround.com/{userId}/{storeId}/feeds/{langCode}/{country|global}/{marketplaceName}.{format}
For example, a store with Italian only and a feed for Shopping Graph in XML is at https://cdn.webround.com/k9J2bWz7vM4nLpXqR1tG8sY3dF5A/32d20f24-6c99-4e72-bdde-a25f91aabb91/feeds/it/global/Google_Shopping.xml.
Structure
A feed has two templates:
- Wrapper. The outside of the file, such as the XML header or the CSV heading. It must contain the
{{items}}placeholder, where the products go. - Item. How each variant is written.
Inside the templates, placeholders are replaced with data:
| Tag | Description |
|---|---|
{{product.id}} | Product ID |
{{product.name}} | Product name (multilingual) |
{{product.seoDescription}} | SEO description (multilingual) |
{{product.htmlDescription}} | Full HTML description (multilingual) |
{{variant.id}} | Variant ID |
{{variant.name}} | Variant name (multilingual) |
{{variant.sku}} | SKU |
{{variant.ean}}, {{variant.gtin}}, {{variant.mpn}} | EAN, GTIN, MPN |
{{variant.upc}}, {{variant.isbn}}, {{variant.asin}} | UPC, ISBN, ASIN |
{{variant.hsCode}}, {{variant.supplierCode}} | Customs (HS) code, supplier code |
{{variant.externalId}} | External ID, such as the one from PrestaShop |
{{variant.netPrice}} | Net price, in the currency of the feed (up to 8 decimals) |
{{variant.grossPrice}} | Gross price, in the currency of the feed (rounded to the decimals of the currency) |
{{variant.compareNetPrice}} | Strikethrough net price |
{{variant.compareGrossPrice}} | Strikethrough gross price |
{{variant.taxRate}} | Tax rate (%) |
{{variant.currencyCode}} | Currency code of the feed, such as EUR |
{{variant.cadence}} | Price cadence (once, monthly…) |
{{variant.availability}} | Availability, as a quantity |
{{variant.availabilityLabel}} | Availability, as text (in stock, out of stock) |
{{variant.quantity}} | Inventory quantity |
{{variant.slug}} | Variant slug |
{{variant.weight}} | Weight in grams |
{{variant.weightKg}} | Weight in kg (1.500) |
{{variant.length}}, {{variant.width}}, {{variant.height}} | Dimensions in cm |
{{variant.volume}} | Volume in cm³ (length × width × height) |
{{variant.metadata.X}}, {{product.metadata.X}} | A metadata field, with its key instead of X |
{{asset.0}}, {{asset.1}}… {{asset.49}} | The first image, the second, up to the 50th |
{{tag.brand}} | Brand |
{{tag.color}}, {{tag.material}}, {{tag.size}}, {{tag.pattern}} | Color, material, size, pattern |
{{tag.gender}}, {{tag.age_group}}, {{tag.condition}} | Gender, age group, condition |
{{tag.product_type}}, {{tag.energy_class}}, {{tag.manufacturer}}, {{tag.model}} | Product type, energy class, manufacturer, model |
{{store.name}}, {{store.domain}} | Store name and domain |
{{collection.top}} | Top-level collection of the product (e.g. BUILDING). Empty if the product is in no collection |
{{collection.sub}} | Collection right under the top-level one (e.g. PVC PIPES). Empty if the product is only in the top-level one |
{{collection.name}} | The most specific collection of the product |
{{collection.path}} | Full path, e.g. BUILDING > PVC PIPES |
Multilingual data is resolved in each language: you get one file for every language of the store.
Template syntax
Besides the placeholders, templates have a few constructs: fallback, modifiers, conditions and lists.
| Syntax | Description |
|---|---|
{{items}} | Only in the wrapper: where the products go |
{{a ?? b}} | Fallback: the first value that is not empty, such as {{variant.metadata.psCombId ?? variant.id}} |
{{field | modifier | other}} | One or more modifiers, applied in order, such as {{product.htmlDescription | strip_html | csv}} |
{{#if field}}…{{else}}…{{/if}} | Shows the block only if the field is not empty ({{else}} is optional) |
{{#if field == "text"}}…{{/if}} | Compares the field with a text, with one of the operators below |
{{#each asset}}{{this}}{{/each}} | Repeats the block for every image |
{{#each tag.product_type}}{{this.value}}{{this.id}}{{/each}} | Repeats the block for every value of a tag; {{this.value}} is the value, {{this.id}} its ID. Modifiers work here too |
| Modifier | Description |
|---|---|
uppercase | Upper case |
lowercase | Lower case |
slugify | Lower case, no accents, symbols replaced by - |
strip_html | Removes HTML tags, decodes entities, collapses spaces |
oneline | Replaces line breaks with a space |
csv | A safe CSV field: always between double quotes, inner quotes doubled |
add:N | Adds a number, such as {{variant.grossPrice | add:6.5}}. Only on numeric fields (prices, tax rate, quantity, weight, dimensions). A gross price keeps the decimals of the currency (2 for EUR, 0 for JPY), a net price up to 8 |
round:N | Rounds to N decimals (0 to 8), such as {{variant.weightKg | round:2}}. Only on numeric fields |
sub:N | Subtracts a number, such as {{variant.grossPrice | sub:2}}. Same rules as add |
mul:N | Multiplies by a number greater than 0, such as {{variant.grossPrice | mul:1.2}} for +20% or mul:0.9 for -10%. Same fields and decimals as add: a gross price is rounded to the decimals of the currency (half away from zero) |
| Operator | Description |
|---|---|
== | Equal to the text |
!= | Different from the text |
contains | Contains the text |
startsWith | Starts with the text |
endsWith | Ends with the text |
How it is generated
- By variant. A product with 5 sizes gives 5 items, as marketplaces like Google Shopping want.
- Visible only. Only variants set as visible are exported.
- Inheritance. A variant that takes its images or dimensions from the product gets the right data in the feed.
- Filters. Link one or more
filterIdsand the feed has only the products that pass them, such as one category or one brand. - Sitemap. When a feed is generated, Webround also updates
sitemap-products.xml.
Example: Google Shopping (XML)
Wrapper:
<?xml version="1.0"?>
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
<channel>
<title>{{store.name}}</title>
<link>{{store.domain}}</link>
<items>
{{items}}
</items>
</channel>
</rss>
Item:
<item>
<g:id>{{variant.id}}</g:id>
<g:title>{{product.name}} - {{variant.name}}</g:title>
<g:description>{{product.seoDescription}}</g:description>
<g:link>{{store.domain}}/p/{{variant.slug}}</g:link>
<g:image_link>{{asset.0}}</g:image_link>
<g:price>{{variant.grossPrice}} EUR</g:price>
<g:availability>{{variant.availabilityLabel}}</g:availability>
<g:brand>{{tag.brand}}</g:brand>
<g:gtin>{{variant.gtin}}</g:gtin>
</item>
Example: CSV
Wrapper:
id,sku,name,price,availability
{{items}}
Item:
{{variant.id | csv}},{{variant.sku | csv}},{{product.name | csv}},{{variant.grossPrice | csv}},{{variant.availabilityLabel | csv}}
After you create a feed, the button generates it right away, without waiting for the night.