Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Products

How to store and upload product data in Optimizely Data Platform (ODP) for an ecommerce use case.

A great use case for Optimizely Data Platform (ODP) is an ecommerce website, which is used for the buying and selling of goods or services. In order to run an ecommerce website, you need products to sell and orders to track from your customers. You can record both easily using ODP.

Starting the ecommerce use case, you want to upload data about your available products to ODP. Buying and selling products are what makes an ecommerce website different from other web pages.

Products

The products object is a "stateful" object, meaning it stores the current state of your product inventory. Events and orders refer to this object to get metadata about a product (such as price) by using the product_id.

Fields

Required fields

The only required field for adding a product object is a product_id.

Display NameField NameData TypeDescription
Product IDproduct_idStringThe unique identifier for the product. Referenced from events.

Recommended fields

These are recommended fields for a product stored on an ecommerce website.

Display NameField NameData TypeDescription
Parent Product IDparent_product_idTextA reference to another product in the table that groups the products together
NamenameTextThe name of the product displayed to your customers
BrandbrandTextThe brand of the product
SKUskuTextThe unique SKU of the product
UPCupcTextThe unique UPC of the product
Image URLimage_urlTextThe URL path to the product's image (including the protocol)
PricepriceNumberThe price of the product
Quantitycustom fieldNumberThe available inventory in stock for the product. This is created as a custom field in your ODP account
Product URLcustom fieldTextThe URL path (including the protocol) to the product's detail page, or a handle or key that can be consistently formed into the URL for all products

Create additional custom fields for key attributes that you may want to make available for reporting, filtering in emails, or displaying in content.

🚧

Parent products

The product-to-parent product relationship is a self-referential hierarchy.

The parent product ID refers to the product id of another record on the product table. Within ODP, there is reporting on parent product names, id, images, and so on. You can also bring these parent products dynamically into emails based on qualifying products. These parent product values are set by querying for the product id that is referred to in the parent product id field of a target product.

A parent product name, for example, is the name field in the product record with the same id referenced as the parent product id on the child record.

The highest level parent in the hierarchy should reference its own product id as the parent product id. As a best practice, parent product ids should reference actual products that are included on the product object.

Product events

See Understand ODP - Events to learn more about ODP events.

typeactionproduct_id
productdetail123
productadd_to_cart123
productremove_from_cart123
productadd_to_wishlist123
productremove_from_wishlist123

Importing and updating products

The products object contains the current state of your product inventory, it does not store historical information about the product. Common reasons to update the products object are:

  • Updating inventory
  • Updated product images
  • Release of new products

📘

Note

Updates to the products object should adhere to the schema defined above.

Reference

There are a number of methods to update the products object. To add products to ODP, you can use the following: