CSV
This topic describes importing data into Optimizely Data Platform (ODP) via CSV.
File Formatting
️ 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
UTF-8
encoded - Values must be comma-delimited
- Records must end with a newline (
\n
) - Any value may be optionally quoted via double quote (
"
) characters - Any field containing a double quote must be quoted. 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
- No carriage return (
\r
) or newline (\n
) may exist within a record - Date/Time fields must be formatted as follows:
Date Format | Examples |
---|---|
Unix Timestamp/Epoch |
|
| |
%Y-%m-%d %H:%M:%S%:z |
|
%Y-%m-%d %H:%M:%S |
|
%m/%d/%y %H:%M |
|
%m/%d/%y %H:%M:%S |
|
%m/%d/%Y %H:%M:%S |
|
%m/%d/%Y %H:%M |
|
Caution
If time and time zone are not provided, the time is assumed to be 12am UTC.
Error Handling
Any record that contains an invalid field will be ignored. If more than 1% of the data is invalid, the entire file will be rejected. The Activity Log will show the status of the uploads, any errors generated, and a success entry if the data is loaded successfully.
File Naming
Object | File Name Prefix |
---|---|
Products | zaius_products |
Customers | zaius_customers |
Orders | zaius_orders |
Events | zaius_events |
Lists | zaius_list |
Where to upload?
UI
- Go to Account Settings -> Integrations.
- Select Upload CSV -> Browse.
- Select the file that follows the file name and format conventions outlined below.
Files can also be imported via Amazon S3
Examples & Samples
Note
The files below are only basic examples. Refer to the ODP schema section to learn about all available default fields and creating custom fields & objects.
Customers
Get more information about the contents of a customer file here.
Products
Get more information about the contents of a product file here.
Orders
Get more information about the contents of an orders import here.
- Shared Fields
- action
- value should be one of the following:
purchase | refund | return | cancel
- value should be one of the following:
- order_id (REQUIRED)
- ts (REQUIRED)
- identifier (REQUIRED - any identifier is accepted)
- action
- Order Summary Fields
- total
- discount
- subtotal
- tax
- shipping
- coupon_code
- first_name
- last_name
- bill_address
- ship_address
Caution
Order Line Item fields (and the associated events) cannot be updated in the future, only summary fields (for refunds, returns, cancellations).
- Order Line Item Fields (one row per line item)
- item_product_id
- item_sku
- item_price
- item_quantity
- item_discount
- item_subtotal
Note
Prefix all custom event fields with
item_
to indicate the field exists on the Event object. Otherwise, it will be assumed you are attempting to update the Orders object.
Events
Get more information about the content of events imports here.
Lists
Get more information about the content of lists imports here.
Caution
Uploading a List file without an "action" column assumes a subscription for each email.
Upload to a Single List
Upload to Multiple Lists
Custom Objects
Get more information about the content custom object imports here.
Note
Replace
customobject
with the name of the custom object
zaius_customobject_example.csv
Important
All custom object updates must include the primary key (or keys in the case of composite keys) in the file (for example,
id
).
Updated 2 days ago