Overview
Optimizely Data Platform (ODP) uses order data for historical analysis, building recommendation models, and triggering or stopping campaigns. You can import order data through uploading historical data and syncing ongoing data.
Here are some helpful links:
- Order field reference – Review your existing default and custom order fields.
- Create custom fields – Create and review custom order fields.
Orders in Optimizely Data Platform
Orders in ODP are represented both as events and as order objects. The event stores the products that are present in the transaction as order line items. The order objects store top-level order data (such as the total, taxes, discounts, and customer information) but not what the customer purchased.
Custom fields
If there are non-standard fields that you would like to capture on an order, you can add custom fields.
- Top-level fields – Go to Objects & Fields and add a custom field directly to the Orders object.
- Item-level fields – Go to Objects & Fields and add a custom field directly to the Events object. Item level fields must start with item_ to pull the data out of the object and connect it to the event.
For details on standard fields and how order data behaves in ODP (including refunds, returns, and cancels), review our developer documentation.
Upload historical order data
You can import historical order information with a CSV file. ODP automatically creates an event for the orders and associates them with the customer you include in the import file. If a customer does not exist in your account, then ODP creates a new customer profile.
You can get a sample file to help you with order formatting here.
Upload a CSV file and add order data in bulk with these steps:
- Go to Account Settings > Integrations > Upload CSV.
- Drag and drop a CSV file onto the Drag & Drop area or select Browse to locate the file elsewhere. Follow the file formatting guidelines outlined below to ensure the information is imported correctly.
Format your data correctly
Begin the file name with zaius_orders and use the CSV UTF-8 format with a header row of field names. Use an identifier field, such as order ID, to import the information. Format the file using one of two ways:
- We recommend repeating the top-level order data for each line item in a purchase, such as with purchase 12345 below. The top-level data must be identical on each row of the purchase.
- You can also leave the top-level order data blank after the first row for each subsequent line in the purchase and only provide action and item-level fields.
Sync ongoing order data
For ongoing data, we do not recommend sending information using JavaScript or other client-side methods due to a higher likelihood of data loss. For example, ad blockers can prevent scripts from loading properly, resulting in a data loss of 1-5%.
We recommend that the data be sent using the ODP HTTP API. You can use the API in conjunction with webhooks to keep all orders and revenue accurate.
HTTP API
- Send purchases with line items using the Events API.
- Create/Update top-level order information using the Objects API.
- Learn more about Orders in the API with in the Order Reference.