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 Name | Field Name | Data Type | Description |
---|---|---|---|
Product ID | product_id | String | The unique identifier for the product. Referenced from events. |
Recommended fields
These are recommended fields for a product stored on an ecommerce website.
Display Name | Field Name | Data Type | Description |
---|---|---|---|
Parent Product ID | parent_product_id | Text | A reference to another product in the table that groups the products together |
Name | name | Text | The name of the product displayed to your customers |
Brand | brand | Text | The brand of the product |
SKU | sku | Text | The unique SKU of the product |
UPC | upc | Text | The unique UPC of the product |
Image URL | image_url | Text | The URL path to the product's image (including the protocol) |
Price | price | Number | The price of the product |
Quantity | custom field | Number | The available inventory in stock for the product. This is created as a custom field in your ODP account |
Product URL | custom field | Text | The 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.
type | action | product_id |
---|---|---|
product | detail | 123 |
product | add_to_cart | 123 |
product | remove_from_cart | 123 |
product | add_to_wishlist | 123 |
product | remove_from_wishlist | 123 |
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:
- Upload data using a CSV file
- ODP REST API's update products endpoint
- Send product data through an ODP Web SDK event
Updated 12 months ago