Product Requirements
You pass the attributes of a product in the tags of an XML feed or in the fields of the Product API.
More Parameters, Better RecommendationsPass as many product parameters as possible: size, color, accessory, material and so on. The more varied the parameters, the more accurately the system picks products for the recipient of a message or a visitor to the site.
The set of attributes depends on your Yespo plan.
| Attribute | Feed tag | Product API field |
|---|---|---|
| Identifier | <g:id> | productId |
| Name | <g:title> | name |
| Brand | <g:brand> | brand |
| Category | <g:google_product_category> | categories |
| Description | <g:description> | description |
| Product link | <g:link> | url |
| Image | <g:image_link> | imageUrl |
| Availability | <g:availability> | isInStock |
| Price | <g:price> — regular, <g:sale_price> — discounted | price — current, oldPrice — before the discount |
| New arrival | <g:new> | a tag in the tags object |
| Currency | — | currency |
| Update date | — | updatedDate |
On the Basic plan every attribute except the discounted price and the new-arrival flag is required; on Professional all of them are. For the API, the fields required to create a product are listed in Syncing Products Through the API, together with JSON request examples.
Some triggers and recommendations on the site need extra attributes. To identify them correctly in the feed, contact support.
Pass the price before the discount in <g:price> and the price after the discount in <g:sale_price>. If the feed has no <g:sale_price>, recommendation blocks have no old price to show and discount triggers don't work.
Through the API the current price goes in price and the price before the discount in oldPrice; oldPrice must be greater than price.
For the new-arrival algorithms to work, pass <g:new> with the values 1 and 0. Through the API the same flag is passed as a tag in the tags object, with the same values 1 and 0. If that data lives in another tag in your feed — custom_label_3, for example — contact support: the algorithm can be pointed at that tag, but the values still have to be 1 and 0.
Tags and Categories
- Products in the feed must be described with
itemtags.- You can pass the category hierarchy as a single value with the
>separator — for example,Shoes>Sneakers. The system expands such a value into a category tree. In recommendation requests, use the lowest-level category.- If a product belongs to several category branches at once, pass the identifiers of all its categories, comma-separated, in an extra feed field and contact support so that the field is included in the category tree.
Product Identifiers and Product Variants
The product identifiers you pass in web tracking events — product views, cart, purchase — must match the product identifiers in the catalog: <g:id> in a feed, productId through the API. If they don't, the system can't find the product in the catalog, and some triggered messages won't be sent.
For products with variants (size, color, and so on), use one of the two approaches consistently:
- Parent products only. Keep one record per product in the feed and pass the parent product identifier in all events.
- Child products. Put the child records in the feed, group them with the
<g:item_group_id>tag that holds the parent product identifier, and pass the child product identifier in the cart and purchase events.
Choose the second approach if messages must show the exact variant the customer selected, with its own price.
Through the API itemGroupId groups the variants of one product.
Product ID LengthA product identifier is limited to 50 characters. A longer value can't be stored, so an order that carries such an item fails to save — even though the same identifier passes in the feed. The limit is the same for every account and isn't raised on request, so keep identifiers within it. One identifier per product is enough; there is no need to combine two of them into a single value.
Image Requirements
Product images must meet the following requirements whichever way they arrive — <g:image_link> in a feed, imageUrl through the API:
- Format: PNG or JPEG (WebP is not supported).
- File size: up to 2 MB. A square aspect ratio is recommended.
- The image URL must be a direct link with an explicit format extension (for example,
.../image.png). Links without a format extension don't pass the validation of Viber messages — sending fails with theInvalid Parameter: image not valid typeerror.
An image passed through the API must be at least 200×200 pixels.
Updated 19 minutes ago
