Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Historical online orders

Code sample for importing historical online orders in XML.

To improve product recommendations from launch, you can import historical online orders to help provide some historical data. The standard format for importing historical online orders is an XML format that contains the historical orders, along with the user who placed the orders and the products that were purchased. For example:

<orders>
  <order refCode="order1" 
         currency="GBP" 
         subTotal="84.2" 
         shipping="3.5" 
         total="87.7" 
         orderDate="2017-04-23T14:25 GMT">
    <user email="[email protected]"/>
    <product refCode="rc1" qty="1" price="5.7"/>
    <product refCode="rc2" qty="5" price="15.7"/>
  </order>
  <order refCode="order2" 
         currency="EUR" 
         subTotal="158,5" 
         shipping="30.5" 
         total="189" 
         orderDate="2017-04-23T14:32 GMT">
    <user email="[email protected]"/>
    <product refCode="rc3" qty="2" price="25.7"/>
    <product refCode="rc4" qty="3" price="35.7"/>
  </order>
</orders>
  • The root element is the element which contains one element for each order.
  • Each consists of the reference code (refCode) of the order (or order number), the currency that the order was placed in, the subTotal, shipping cost, total value of the order, and the orderDate. Each order contains user information and ordered products information.
    • The element contains the email of the user who placed the order.
    • The element consists of the product's reference code (as provided in the product catalog feed for Optimizely) along with the ordered quantity and ordered price (per unit).

📘

Note

The price should be the final price per unit that the user paid for the product.