HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityLog In

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

1435708800

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 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

ObjectFile Name Prefix
Productszaius_products
Customerszaius_customers
Orderszaius_orders
Eventszaius_events
Listszaius_list

Where to upload?

UI

  1. Go to Account Settings -> Integrations.
  2. Select Upload CSV -> Browse.
  3. 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.

zaius_customers_example.csv

Products

Get more information about the contents of a product file here.

zaius_products_example.csv

Orders

Get more information about the contents of an orders import here.

zaius_orders_example.csv

  • Shared Fields
    • action
      • value should be one of the following: purchase | refund | return | cancel
    • order_id (REQUIRED)
    • ts (REQUIRED)
    • identifier (REQUIRED - any identifier is accepted)
  • 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.

zaius_events_example.csv

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

zaius_list_yourlistidhere.csv

Upload to Multiple Lists

zaius_list_example.csv

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).


Did this page help you?