This post is also available in:
In order to run properly, Samba requires integration with the following data feeds:
If you created your e-shop via one of the supported e-commerce platforms, you don’t have to bother with data integration. Just follow the step-by-step guide here. If you use a different, unsupported platform, do not despair, we’re working on the integration of other popular platforms. Until then, please, follow the step-by-step guide, which you can find below.
Links (publicly accessible, or containing access data in the format https: // username: password@youreshop.com/feedname.xml) to these feeds can be provided in the section Settings – Integrations – Data integration – Connection settings in Samba.
To save the changes, press Save configuration.
Once you have filled in all the data, press Refresh. Samba will download the feeds immediately according to your settings. You’ll usually see the output from our validation in minutes, so you can fix the errors.
Regular updates:
- Data feeds are updated once a day by default.
- Data feeds are always updated as a whole. Therefore, if the update fails for any reason, even partially processed data from one feed is not processed.
- Samba automatically attempts to update the data again at progressively longer intervals until the time of the next scheduled update.
- If you don’t want to use one of the feeds and need to update your data, use the so-called Empty Feeds.
Properties of the data feeds
- XML format
- UTF-8LE coding
- do NOT use unicode control characters (except the CR and LF characters)
Products feed
This feed contains the database of all your products, that you offer on your e-shop. For the best results, we recommend including as many optional parameters as possible. Thanks to this data feed, Samba is able to recognize the parameters of the products (type, brand, category, price category, colour, size,….) and then offer this product to the right customer. Samba works with the stock information and special offers as well, so it doesn’t offer a product, that you don’t have in stock and on the other hand, offers a product, that is on sale, and more.
Supported parameters
Name | Type | Required | Description |
---|---|---|---|
PRODUCT_ID | String | yes | product ID |
TITLE | String | yes | product name |
PRICE | Float, >=0 | yes | selling price (tax included, without shipping and handling) |
URL | String | yes | product URL |
IMAGE | String | no | product picture URL (approx 300x300 px) |
DESCRIPTION | String | no | detail description of the product (without HTML tags) |
BRAND | String | no | product brand |
STOCK | Integer, >=0, default:1 | no | number of pieces in stock |
PRICE_BEFORE_DISCOUNT | Float, >0, PRICE_BEFORE_DISCOUNT > PRICE | no | price before discount (tax included) |
PRICE_BUY | Float, >0 | no | cost price of the product (for calculating profit margin) |
PRICES | [NAME, VALUE] | no | special prices for different customer groups, see PRICE_CATEGORY in the customer feed |
CATEGORYTEXT | String | no | categories that include the product, seperated by "|" |
PRODUCT_LINE | String | no | product line |
VARIANT | Products list | no | see product variants below |
SHOW | Boolean, default: TRUE | no | can we show this product? |
PARAMETER | [NAME, VALUE] | no | Other parameters (NAME does not have to be unique, please see example below) |
In case of multiple occurrences of a parameter with the same NAME, all relevant VALUEs are processed. As part of the filtering, it is possible to search among all values.
Example of the products feed
<?xml version="1.0" encoding="utf-8"?> <PRODUCTS> <PRODUCT> <PRODUCT_ID>D45S8741545SD</PRODUCT_ID> <BRAND>Product Brand</BRAND> <TITLE>Product name</TITLE> <DESCRIPTION>Detailed description of this product</DESCRIPTION> <PRICE>40.1</PRICE> <PRICE_BEFORE_DISCOUNT>42.1</PRICE_BEFORE_DISCOUNT> <STOCK>60</STOCK> <URL>http://www.myeshop.com/path/to/the/product</URL> <IMAGE>http://www.myeshop.com/path/to/the/image.jpg</IMAGE> <CATEGORYTEXT>Clothes | Men | Trousers</CATEGORYTEXT> <PRICES> <CATEGORY> <NAME>guest</NAME> <PRICE>41</PRICE> <PRICE_BEFORE_DISCOUNT>42.1</PRICE_BEFORE_DISCOUNT> </CATEGORY> <CATEGORY> <NAME>vip</NAME> <PRICE>40</PRICE> <PRICE_BEFORE_DISCOUNT>45.1</PRICE_BEFORE_DISCOUNT> </CATEGORY> </PRICES> <PARAMETERS> <PARAMETER> <NAME>Color</NAME> <VALUE>White</VALUE> </PARAMETER> </PARAMETERS> <VARIANT> <PRODUCT_ID>D45S8741545SD-XXL</PRODUCT_ID> <TITLE>Product name XXL</TITLE> <DESCRIPTION>Detailed description of this product XXL</DESCRIPTION> <PARAMETERS> <PARAMETER> <NAME>Size</NAME> <VALUE>XXL</VALUE> </PARAMETER> <PARAMETER> <NAME>EAN</NAME> <VALUE>467891186861118</VALUE> </PARAMETER> </PARAMETERS> <PRICE>40.1</PRICE> <PRICES> <CATEGORY> <NAME>guest</NAME> <PRICE>41</PRICE> <PRICE_BEFORE_DISCOUNT>42.1</PRICE_BEFORE_DISCOUNT> </CATEGORY> <CATEGORY> <NAME>vip</NAME> <PRICE>40</PRICE> <PRICE_BEFORE_DISCOUNT>45.1</PRICE_BEFORE_DISCOUNT> </CATEGORY> </PRICES> <STOCK>10</STOCK> <IMAGE>http://www.myeshop.com/path/to/the/imageXXL.jpg</IMAGE> <URL>http://www.myeshop.com/path/to/the/product?variant=xxl</URL> </VARIANT> <VARIANT> <PRODUCT_ID>D45S8741545SD-L</PRODUCT_ID> <TITLE>Product name L</TITLE> <DESCRIPTION>Detailed description of this product L</DESCRIPTION> <PARAMETERS> <PARAMETER> <NAME>Size</NAME> <VALUE>L</VALUE> </PARAMETER> <PARAMETER> <NAME>EAN</NAME> <VALUE>467891186861118</VALUE> </PARAMETER> </PARAMETERS> <PRICE>40.1</PRICE> <PRICES> <CATEGORY> <NAME>guest</NAME> <PRICE>41</PRICE> <PRICE_BEFORE_DISCOUNT>42.1</PRICE_BEFORE_DISCOUNT> </CATEGORY> <CATEGORY> <NAME>vip</NAME> <PRICE>40</PRICE> <PRICE_BEFORE_DISCOUNT>45.1</PRICE_BEFORE_DISCOUNT> </CATEGORY> </PRICES> <STOCK>10</STOCK> <IMAGE>http://www.myeshop.com/path/to/the/imageL.jpg</IMAGE> <URL>http://www.myeshop.com/path/to/the/product?variant=l</URL> </VARIANT> </PRODUCT> </PRODUCTS>
Customers feed
Customers feed should contain the whole database of your customers. Samba can adjust its personalization based on other metaparameters, such as gender or the date of registration.
Samba is able to distinguish 3 levels of newsletter subscription.
- every day
- special occasions
- never
Samba targets only those customers who really want to receive newsletters.
For information on how the number of customers affects your payment plan, see this article.
Supported parameters
Name | Type | Required | Description |
---|---|---|---|
CUSTOMER_ID | String | yes | Customer ID |
NEWSLETTER_FREQUENCY | Enum: every day | special occasions | never | yes | Subscription frequency (never = unsubscribed) |
NLF_TIME | Datetime (as string) | no | Datetime in the YYYY-MM-DDThh:mm:ss.sTZD format (more info) Time of the customer's subscription change |
String | no | A valid email address | |
REGISTRATION | Date & time (as a String) | no | Date and time of registration in the following format: YYYY-MM-DDThh:mm:ss.sTZD (more info), default: "1970-01-01" |
FIRST_NAME | String | no | First name |
LAST_NAME | String | no | Last name |
ZIP_CODE | String | no | ZIP code |
PHONE | String | no | Phone number with the Incl. plus sign and country code (e.g. "+420xxxxxxxxx" for Czech Republic, or +11234567890 for USA) |
SMS_FREQUENCY | Enum: every day | special occasions | never | no | SMS subscription frequency (never = unsubscribed), default: "never" |
DATA_PERMISSION | Enum: full | do_not_personalize | anonymized_only | no | default: "full" |
PRICE_CATEGORY | String | no | customer group for determining special product prices - see PRICES in products feed |
PARAMETERS | [NAME, VALUE] | no | Other parameters (NAME does not have to be unique, please see example below) |
In case of multiple occurrence of a parameter with the same NAME, all relevant VALUEs are processed. As part of the filtering, it is possible to search among all values. When used in a template by inserting a dynamic variable, one of the values is used randomly.
Example of customers feed
<?xml version="1.0" encoding="utf-8"?> <CUSTOMERS> <CUSTOMER> <CUSTOMER_ID>D45S8741545SD</CUSTOMER_ID> <EMAIL>jan.novak@email.cz</EMAIL> <REGISTRATION>2014-12-31T03:53:43.962Z</REGISTRATION> <FIRST_NAME>Jan</FIRST_NAME> <LAST_NAME>Novák</LAST_NAME> <NEWSLETTER_FREQUENCY>every day</NEWSLETTER_FREQUENCY> <NLF_TIME>2014-12-31T03:56:43.962Z</NLF_TIME> <ZIP_CODE>15000</ZIP_CODE> <PRICE_CATEGORY>vip</PRICE_CATEGORY> <PARAMETERS> <PARAMETER> <NAME>Bonus points</NAME> <VALUE>100</VALUE> </PARAMETER> <PARAMETER> <NAME>Gender</NAME> <VALUE>male</VALUE> </PARAMETER> </PARAMETERS> </CUSTOMER> </CUSTOMERS>
Incremental customers feed
Samba supports the so-called incremental data feed, which means that this feed contains only those customers that have been created or changed recently. This reduces the load on the servers, where you only need to generate the complete database of customers for the initial update and a small increment every next day.
Procedure
- Initial import of history
- Set the customers feed to the Complete type.
- Enter the URL of the complete feed.
- Perform a data update in Samba.
- Incremental processing
- Set the customers feed to the Incremental type.
- Insert the URL of the incremental feed.
- Perform a data update in Samba.
The way the whole process works is that once you switch the type to Incremental, Samba automatically maintains the customers history collected so far and aggregates each new increment into this history using the upsert method on CUSTOMER_ID
. This means that
- a new
CUSTOMER_ID
appears in the increment – the record is processed and added to the accumulated database in Samba - a previously processed
CUSTOMER_ID
appears in the increment – the existing customer record is discarded and only the parameters (and items) specified in the increment are processed for the customer
Until you switch the setting back to the Complete type, Samba keeps this accumulated history in its database.
Incremental type
Samba distinguishes the following types of increments based on how the URL is dynamized:
- Static URL
- Use when you always generate on one specific and unchanging URL all customers that have changed during a selected period (the length of the period is up to you, typically 7 days).
- E.g. https://samba.ai/export/customers/customers_increment.xml
- Specific date
- Use when you periodically generate a new file for a specific time period – for example, you generate a new daily increment every day.
- E.g. https://samba.ai/export/customers/customers_increment_{date}.xml
- Date From – To
- Use when you have a service on your side ready to return order exports by
from
/to
attributes. - Samba automatically selects
from
as the date of the last successful run,to
is selected as “today”. This ensures the next run to reload boundary data that may have been incomplete at the time of processing. - E.g. https://samba.ai/export/customers/customers_increment_{from}_{to}.xml
- Use when you have a service on your side ready to return order exports by
Using the “Latest increment available X days ago” option, you can set Samba to e.g. download an increment with a 1-day delay (e.g. on March 17th Samba will download at most an increment with a date of March 16th and not a newer one). This can prevent the entire data update from failing due to data unavailability on your side.
Orders feed
Orders feed should ideally contain history of your orders, that happened on your eshop (we recommend the history to be at least 2 years old, but whole history is preferred or you can also use increments, as explained below). Samba uses this feed to analyse purchase patterns of your customers, which is then being used to personalise. All products in this data feed must be present in the product feed, or they will be marked as “Invalid orders” and ignored by the system.
Samba currently supports 3 order states:
- finished – finished order, customer has paid or received the goods. This is the only state Samba is actually working with.
- created – order has been created and is waiting for finishing (payment, delivery, etc.).
- canceled – cancelled or deleted order (by the customer or the eshop).
If you allow customers to create orders without registration, use the EMAIL
element instead of CUSTOMER_ID
and, if you can, PHONE
and ZIP_CODE
as well. Samba will create virtual customers, which you can then use for targeting purposes during campaign creation.
In detail: If an unknown CUSTOMER_ID
is specified (or is not specified at all) in the specific order and there is a customer (in customer feed) with the same EMAIL
as used in this order, the order is then automatically assigned to the customer based on the EMAIL
element. However, if there is no such EMAIL
in the customer feed, then the value in EMAIL
will be temporarily used as a new CUSTOMER_ID
so that the order can be processed. Orders without valid EMAIL
and CUSTOMER_ID
will not be processed at all.
Based on your customer terms and conditions you can select the following option in the Connection settings for these customers:
Samba retains order history for a maximum of 10 years from the created date.
Supported parameters
ITEMS
Each order must include all products from that order. The product price here determines the selling price paid by the customer (excluding shipping and handling, including VAT).
Name | Type | Required | Description |
---|---|---|---|
PRODUCT_ID | String | yes | ID of the product or its variant |
AMOUNT | Number (integer, >0) | no | Quantity of the product (default: 1) |
PRICE | Number (>=0) | no | Subtotal of all of the pieces of the product, tax included, without shipping and handling. |
Example of orders feed
<?xml version="1.0" encoding="utf-8"?> <ORDERS> <ORDER> <ORDER_ID>5ds465d</ORDER_ID> <CUSTOMER_ID>d4s5a6sd6as</CUSTOMER_ID> <CREATED_ON>2014-12-31T03:53:43.962Z</CREATED_ON> <FINISHED_ON>2015-01-05T03:53:43.962Z</FINISHED_ON> <STATUS>finished</STATUS> <ZIP_CODE>15500</ZIP_CODE> <COUNTRY_CODE>CZ</COUNTRY_CODE> <ITEMS> <ITEM> <PRODUCT_ID>DAS656</PRODUCT_ID> <AMOUNT>6</AMOUNT> <PRICE>36</PRICE> </ITEM> </ITEMS> </ORDER> <ORDER> <ORDER_ID>35DS45</ORDER_ID> <EMAIL>jan.novak@email.cz</EMAIL> <CREATED_ON>2014-12-31T03:53:43.962Z</CREATED_ON> <FINISHED_ON>2015-01-05T03:53:43.962Z</FINISHED_ON> <STATUS>finished</STATUS> <ZIP_CODE>15500</ZIP_CODE> <COUNTRY_CODE>CZ</COUNTRY_CODE> <ITEMS> <ITEM> <PRODUCT_ID>DAS656</PRODUCT_ID> <AMOUNT>6</AMOUNT> <PRICE>36</PRICE> </ITEM> </ITEMS> </ORDER> </ORDERS>
Incremental orders feed
Samba supports the so-called incremental data feed, which means that this feed contains only those orders that have been created or changed recently. This reduces the load on the servers, where you only need to generate the complete history for the initial update and a small increment every next day.
Procedure
- Initial import of history
- Set the order feed to the Complete type.
- Enter the URL of the complete feed.
- Perform a data update in Samba.
- Incremental processing
- Set the order feed to the Incremental type.
- Insert the URL of the incremental feed.
- Perform a data update in Samba.
The way the whole process works is that once you switch the type to Incremental, Samba automatically maintains the order history collected so far and aggregates each new increment into this history using the upsert method on ORDER_ID
. This means that
- a new
ORDER_ID
appears in the increment – the record is processed and added to the accumulated database in Samba - a previously processed
ORDER_ID
appears in the increment – the existing order record is discarded and only the parameters (and items) specified in the increment are processed for the order
Until you switch the setting back to the Complete type, Samba keeps this accumulated history in its database.
Incremental type
Samba distinguishes the following types of increments based on how the URL is dynamized:
- Static URL
- Use when you always generate on one specific and unchanging URL all orders that have changed during a selected period (the length of the period is up to you, typically 7 days).
- E.g. https://samba.ai/export/orders/orders_increment.xml
- Specific date
- Use when you periodically generate a new file for a specific time period – for example, you generate a new daily increment every day.
- E.g. https://samba.ai/export/orders/orders_increment_{date}.xml
- Date From – To
- Use when you have a service on your side ready to return order exports by
from
/to
attributes. - Samba automatically selects
from
as the date of the last successful run,to
is selected as “today”. This ensures the next run to reload boundary data that may have been incomplete at the time of processing. - E.g. https://samba.ai/export/orders/orders_increment_{from}_{to}.xml
- Use when you have a service on your side ready to return order exports by
Using the “Latest increment available X days ago” option, you can set Samba to e.g. download an increment with a 1-day delay (e.g. on March 17th Samba will download at most an increment with a date of March 16th and not a newer one). This can prevent the entire data update from failing due to data unavailability on your side.
Using the “Keep order history for a period of” option, you can choose a “floating window” to continuously delete old orders. If the time since the order created date exceeds the selected time, the order will be removed from the cumulative database.
- Default value is 24 months
- Minimum value is 3 months
- Maximum value is 120 months (this value is also applied to the complete order feed)
Processed data
Only those orders from the increment that are valid at the moment are processed and accumulated into the history – it means that all mandatory attributes have to be correct. Samba then processes only those orders for a given data update that are fully determined in terms of the existence of the customer in the customer feed and the existence of the product in the product feed.
Customer in order
If an unknown CUSTOMER_ID
is specified (or is not specified at all) in the specific order and there is a customer (in customer feed) with the same EMAIL
as used in this order, the order is then automatically assigned to the customer based on the EMAIL
element.
However, if there is no such EMAIL
in the customer feed, then the value in EMAIL
will be temporarily used for generating a new virtual customer with ID equal to EMAIL
and this particular order is merged into the accumulated history. However, this order is processed only as long as the order is part of the increment. At any time later, the customer is no longer generated and therefore the order is not processed, until a customer with a CUSTOMER_ID
equal to EMAIL
appears in the customer feed again.
If at some point in time the customer CUSTOMER_ID
listed for an order that has undergone incremental processing and has been stored in the accumulated database disappears, it will not be processed and read in Samba until the CUSTOMER_ID
appears again in the customer feed.
Orders without valid EMAIL
and CUSTOMER_ID
will not be processed at all.
Product in order
When using increments, it can generally be said that (analogous to the above for a customer in an order) only those product items that contain the products listed in the product data feed are processed. In the case of an incremental data feed, let’s demonstrate how it works with the following example:
- Suppose there has been a one-time retrieval of complete data within a data feed and now overnight increments are being used within the same account.
- In the example, we have order “Ord1” in the increment (from January 1st), which contains product called “Prod1”:
- On the January 1st, an increment of the order feed will be downloaded, which contains order “Ord1” and in the same time there is a “Prod1” in the product data feed. The order will be processed in this case.
- A day later (January 2nd) the order “Ord1” is no longer in the increment and the product “Prod1” is no longer in the product data feed. The order will not be processed in this case.
- The following day (January 3rd) the order “Ord1” is still not in the increment, but the product “Prod1” is again shown in the product data feed. The order will be processed again in this case.
As we can see, the determining moment for Samba is, whether the product is contained in the product data feed within the time of the last process of the increment – only in this case the data history is correctly saved into the accumulated history of orders. In the following days, the order will be processed again only in case the product is currently residing in the product data feed.
Category feed
The category feed should include the tree of categories used in products feed. TITLE in this feed must correspond to CATEGORYTEXT in product feed.
Supported parameters
Example of category feed
<?xml version="1.0" encoding="utf-8"?> <CATEGORY> <ITEM> <TITLE>Category</Title> <URL>http://www.myeshop.cz/way/to/category</URL> <ITEM> <TITLE>Subcategory</Title> <URL>http://www.myeshop.cz/way/to/Subcategory</URL> </ITEM> </ITEM> <ITEM> <TITLE>Category A</Title> <URL>http://www.myeshop.cz/way/to/categorya</URL> <ITEM> <TITLE>Subcategory A</Title> <URL>http://www.myeshop.cz/way/to/Subcategorya</URL> <ITEM> <TITLE>Subcategory B</Title> <URL>http://www.myeshop.cz/way/to/Subcategoryb</URL> </ITEM> </ITEM> </ITEM> </CATEGORY>
Using empty feeds
If you don’t use some of the feeds and you need to update the data in Samba, you can simply use the following links to the so-called empty feeds. This can be especially useful if you only want to integrate the customer database in Samba and need to synchronize unsubscribed customers and recalculate customer filters. The advantage is that you can then continue to manage your database using Contact Management.
Feed type | URL |
Products | https://samba-feed-examples.s3.eu-west-1.amazonaws.com/empty/products_empty.xml |
Orders | https://samba-feed-examples.s3.eu-west-1.amazonaws.com/empty/orders_empty.xml |
Customers | https://samba-feed-examples.s3.eu-west-1.amazonaws.com/empty/customers_empty.xml |