How to import old purchases

If you want our system to automatically analyse customer behaviour and compute some attributes on users you can import historical orders into our system.

Importing order history has the following benefits:

  • some algorithms can deliver results immediately
  • you can start running campaigns on those events
  • you can segment users based on the data
  • update user profiles with order values

File Format

Orders can be imported using a csv file with the following columns. Each order should be on a single line.

“email”;”orderId”;”date”;”items”;”total”

Please respect the following:

email should be a valid email address.

items column has the following format “itemId:qty|itemId:qty|itemId:qty” where: ItemId represents your product id (the same one from the product feed) and qty represents how many items were bought. Items are separated by | (pipe)

Notes: for items, do not use item title or other value that is not the item ID from the product feed. You can leave this field empty, but do not skip it.

date column should be a valid ISO date or timestamp:

‘2008-08-30T01:45:36.123Z’ or ‘2008-08-30’ or 1519143392

total column should be a valid float number: 349.23 (use point for decimals and no other characters)

Example file:

“email”;”orderId”;”date”;”items”;”total”

[email protected]”;”12345″;”2008-08-30″;”doge:1|fiero:2|cato:1″;”234.20″

[email protected]”;”21333″;”2008-08-14T01:45:36.123Z”;”doge:3″;”37.10″

Important:

Once imported, purchase events that are generated and effects for importing them can’t be canceled.

Also, a second import will fail, because orderID’s need to be unique.

Things to consider:

Any line of the csv that is invalid will not be considered. You can skip quotes around fields, but is a general recommendation to have them.

Email and Date are required in order to create the event.

In order to take products into consideration,  you need to have them previously imported into the database (import using the product feed). Also, make sure you use the same product id’s as the ones in the product feed.

If products already exists, the total value of the purchase will be automatically calculated and you will be able to segment users base on products/categories and so on.

If it’s impossible to include products into the csv, you can set the total, so customer lifetime value will be automatically calculated.

It is best to get in touch with us for a validation before importing orders.

You can either upload the file or insert a public URL under Setup -> Order Importer

Import Results

There will be 3 events in your account history after importing old purchases:

  • upload the file;
  • load the import;
  • finish the import / results;

Related Articles