Use these placeholders to insert product data into a message: data of a single product from the Product Catalog, or the products in the wishlist, abandoned cart, abandoned browse, transactions, or recommended products of a contact. Instead of the Product Catalog, the product data can also come from a related data set.
To filter or sort the products, see Filter and Sort eCommerce Data. For a step-by-step example with related data, see Personalize Emails with eCommerce and Related Data.
Product Catalog
The function ecx:productCatalog returns a property of a single product from the Product Catalog. The product is identified by its SKU. It does not have to be on a wishlist or in an abandoned cart of the contact.
The Product Catalog is also the data source for the eCommerce triggers Back to stock, Low stock, and Price drop. See eCommerce Triggers.
Syntax
<%${ecx:productCatalog('productSKU', 'propertyName')}%>Example
<%${ecx:productCatalog('111-222-333', 'productName')}%>Available Properties
The following properties are available for each product, both with ecx:productCatalog and in the eCommerce tables.
Property | Type |
|---|---|
| String |
| String |
| Map<String, String> |
| Float |
| Map<String, Float> |
| Map<String, String> |
| Integer |
| String |
| String |
| String |
| String |
| String |
| Float |
| Map<String, Float> |
| String |
| Map<String, String> |
| String |
Localized Values
For localized values, ecx:productCatalog accepts two notations: the map property with the key in square brackets, or the property name with the key as a suffix.
Property | Notations |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
eCommerce Tables
The eCommerce tables contain the products of a contact. The data of each product comes from the Product Catalog. A product must therefore exist in the Product Catalog and in the eCommerce table under the same SKU. Because a table can contain several products, insert them with a ForEach loop.
Data | Reference |
|---|---|
Wishlist |
|
Abandoned cart |
|
Abandoned browse |
|
Transactions |
|
Recommended products |
|
Example
The following loop inserts the name and SKU of each product in the abandoned cart. For another table, replace the reference.
<%ForEach var="item" items="${user.abandonedCartProducts}"%>
<%${item['productName']}%> (<%${item['productSKU']}%>)<br>
<%/ForEach%>eCommerce Tables with Related Data
The product data can also come from a related data set instead of the Product Catalog. This lets you use your own product columns. The key of the related data set must be the product SKU, and the key must be unique and unlinked. In the reference, add RD and the name of the related data set.
Data | Reference |
|---|---|
Wishlist |
|
Abandoned cart |
|
Abandoned browse |
|
Recommended products |
|
Example
The related data set myrdlistwithproductdata contains the columns description and price. The following loop inserts these values for each product on the wishlist:
<%ForEach var="item" items="${user.wishlistProductsRD['myrdlistwithproductdata']}"%>
<%${item['productSKU']}%>: <%${item['description']}%>, <%${item['price']}%><br>
<%/ForEach%>Note
eCommerce triggers cannot be set up with related data. They always use the Product Catalog.
FreeMarker Syntax
In-App messages, mobile push, web push, and AMP emails use the FreeMarker template engine. The data is the same, but the syntax differs from the email personalization above.
Product Catalog
${productCatalog('111-222-333', 'productName')}eCommerce Tables
For another table, replace the reference, for example user.wishlistProducts.
<#list user.abandonedCartProducts as item>
${item['productName']}
${item['productSKU']}
</#list>eCommerce Tables with Related Data
For abandoned cart and abandoned browse, replace the reference accordingly.
<#list user.wishlistProductsRD['myrdlistwithproductdata'] as key, values>
<#list values as item>
${item['productName']}
</#list>
</#list>