Used for:
- Message Content
Overview
The products collection contains all product data related to a product catalog. Product data can be used to personalize message content. The most common product related attributes are provided by default as part of the schema and include: product name, category, price, etc. Some attributes are set as arrays and can include customizable name/value pairs such as color:blue, size:large, etc.
Learn more about product attributes in the API article.
How Products Are Stored
Product records are stored in the Products Collection. Below is a simple example of how a product is stored in Cordial as a JSON object.
{ "productID": "skirt0912", "productName": "Denim Skirt", "price": 19.99, "variants": [ { "sku": "skirt0912", "attr": { "color": "blue", "size": "8" } } ] }
The example above shows the standard fields of productID, productName and price as well as an array of variants containing the SKU and product attributes.
Importing Products
A product catalog is loaded into Cordial via the API. Learn more about product collections and the API.
In addition to using API, product data can automatically be added via the JavaScript listener embedded on your site. The crdl(cartitem) method adds data about the products placed in the shopping cart by visitors on your website. Similarly, the crdl(order) method adds data associated with a purchase event including the supplied product details.
Viewing Products
A product collection can be viewed within the UI or via an API call.
To view a product collection in the UI, navigate to Data › Product Data. You will see a list of all the products in the collection. The collection can be viewed as either a table, as thumbnails or a list.
To view details of each product in a JSON format, hover over the arrow in each product row.

To view a product collection via an API call, read the article about accessing product data using the API.
Using Products in a Message
Message content can be personalized with products from your catalog using the Smarty getProducts method.
For example, a contact could be sent a message showing products on sale or products recently added.
Displaying Products in a Message Based on Past Orders
When displaying products in a message based on an order, it's recommended to use product data from the product catalog as opposed to product data from the order. This is because product catalog data (branding, images, descriptions) may be more up to date than product data stored with an order that happened in the past.
For example, you could send a message to a contact that ordered a product last year. If you're updating your product catalog on a regular basis, the product images may be different at the time the message is sent. Using Smarty, you can reference the product ID from the order and relate that to the product data stored in the product catalog. This way, you can be sure you are displaying the most recent updates to the product.
Learn more about using Smarty products in a message.
In the next article learn about orders.
Comments
0 comments
Please sign in to leave a comment.