Import data using CSV
Upload data
To upload your data with a CSV file:
- Go to Data Setup > Integrations.
- Click Upload CSV.
- You can drag and drop your file onto the page or click browse to search for the file on your device.
Note
Each file you upload must meet the format and naming requirements described below.
File format requirements
Warning
Values that are blank ("") or null will DELETE the field value.
For example, if you upload a file with a gender column and there is a customer record without that column filled, that will erase what is presently on the customer record.
- Values must be encoded with UTF-8.
- Values must be comma delimited.
- Records must end with a newline (\n), and no carriage return (\r) or newline (\n) may exist within a record.
- Optionally, values must be quoted using double quote (") characters. You must quote any field containing a double quote. The escape character for an embedded quote is a second quote character. (For example: "Customers think this product is ""Amazing!""").
- Each record must contain exactly the same number of fields as the header does.
- Date/time fields must be formatted as follows:
Date Format | Example |
|---|---|
Unix timestamp/epoch | `1435708800` |
[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) | `2019-04-11T18:43:29+00:00` `2019-04-11T18:43:29Z` `2019-04-11` |
%Y-%m-%d %H:%M:%S%:z | `2014-09-01 13:34:08+00:00` |
%Y-%m-%d %H:%M:%S | `2014-09-01 13:34:08` |
%m/%d/%y %H:%M | `09/01/14 13:34` |
%m/%d/%y %H:%M:%S | `09/01/14 13:34:08` |
%m/%d/%Y %H:%M:%S | `09/01/2014 13:34:08` |
%m/%d/%Y %H:%M | `09/01/2014 13:34` |
Caution
If time and time zone are not provided, the time is assumed to be 12 AM UTC.
Error handling
Any record that contains an invalid field is ignored. If more than 1% of the data is invalid, the entire file is rejected. Go to Settings > Activity Log to view the status of the uploads. On that page, you can view any errors generated and successful upload entries.
File name requirements and example CSV files
Note
The example files are simple examples. See the ODP schema section to learn about available default and custom fields and objects.
Object | File name prefix | Example file | Comments |
|---|---|---|---|
Customers | `odp_customers` | [odp_customers_example.csv](https://world.optimizely.com/globalassets/downloads/odp/odp_customers_example.csv) | |
Products | `odp_products` | [odp_products_example.csv](https://world.optimizely.com/globalassets/downloads/odp/odp_products_example.csv) | |
Orders | `odp_orders` | [odp_orders_example.csv](https://world.optimizely.com/globalassets/downloads/odp/odp_orders_example.csv) | See the [Orders fields](#orders-fields) section |
Events | `odp_events` | [odp_events_example.csv](https://world.optimizely.com/globalassets/downloads/odp/odp_events_example.csv) | Use an identifier field, such as `order_id`, to properly associate the event with a customer profile. |
Lists | `odp_list` | Upload to a Single List [odp_list_yourlistidhere.csv](https://world.optimizely.com/globalassets/downloads/odp/odp_list_yourlistidhere.csv) Upload to Multiple Lists [odp_list_example.csv](https://world.optimizely.com/globalassets/downloads/odp/odp_list_example.csv) | See the [Lists imports](#lists-imports) section |
Custom | `odp_customobject` | [odp_customobject_example.csv](https://world.optimizely.com/globalassets/downloads/odp/odp_customobject_example.csv) | Replace `customobject` with the name of the custom object. All custom object updates must include the primary key (or keys in the case of composite keys) in the file (for example, `id`). |
We currently also support the zaius_ prefix.
Orders fields
Orders in ODP are represented both as Events and as Orders objects. The Events object stores item-level fields, meaning products that a customer purchased. The Orders object stores top-level order fields, meaning the order total, taxes, discounts and customer information. Format the file using one of the following options:
- (Recommended) Repeat the top-level order fields for each line item in a purchase. The top-level fields must be identical on each row of the purchase.
- Leave the top-level order field blank after the first row for each subsequent line in the purchase and only provide shared and item-level fields.
Field | Shared, top-level, or item-level | Comments |
|---|---|---|
`action` | shared | value should be one of the following: `purchase` `refund` `return`, or `cancel` |
`order_id` | shared | Required |
`ts` | shared | Required |
`identifier` | shared | Any identifier is accepted |
`total` | top-level | N/A |
`discount` | top-level | N/A |
`subtotal` | top-level | N/A |
`tax` | top-level | N/A |
`shipping` | top-level | N/A |
`coupon_code` | top-level | N/A |
`first_name` | top-level | N/A |
`last_name` | top-level | N/A |
`bill_address` | top-level | N/A |
`ship_address` | top-level | N/A |
`item_product_id` | item-level | One row per line item |
`item_sku` | item-level | One row per line item |
`item_price` | item-level | One row per line item |
`item_quantity` | item-level | One row per line item |
`item_discount` | item-level | One row per line item |
`item_subtotal` | item-level | One row per line item |
Important
You cannot update order item-level fields (and the associated events) in the future. Only top-level fields for refunds, returns, and cancellations.
Note
Prefix all custom event fields with item_ to indicate the field exists on the Events object. Otherwise, ODP assumes you are attempting to update the Orders object.
Lists imports
- Use an identifier field, such as email, in the CSV file. Optionally, include an action field (subscribe or unsubscribe). If you do not include an action column, ODP assumes a subscription for each email.
- Only some accounts have the optional customer_id field. If your account does not have this field, do not include it in your import file. Additionally, if an email value is available, do not use the optional customer_id field. Only use the customer_id field when an email is not available.
- A list import does not update the customer record with new or changed attributes. It adds customers to a list or a subscription. To update the customer record with new or changed attributes, use the Customers import.
Note
Events, customers, products, and orders are uploaded on the Data Setup > Integrations page of each ODP account. However, lists must be uploaded on the email list's detail page.
Import marketing consent data
In ODP, marketing consent is an attribute of each identifier (for example, each email address), not the entire customer profile, and is not updated by the customer data import.
To import marketing consent data, see Understand marketing consent. File names for consent imports begin with zaius_events. If no value is provided for consent (null), consent is implied.