Placeholders for eCommerce Data

Prev Next

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

productSKU

String

productName

String

localizedProductNames

Map<String, String>

productPrice

Float

localizedProductPrices

Map<String, Float>

variant

Map<String, String>

stockTotal

Integer

productURL

String

imageURL

String

zoomImageURL

String

brand

String

category

String

msrp

Float

localizedMsrp

Map<String, Float>

description

String

localizedDescriptions

Map<String, String>

customAttribute1-5

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

productName

<%${ecx:productCatalog('aaa-bbb-ccc','localizedProductNames')['de']}%>

<%${ecx:productCatalog('aaa-bbb-ccc','productName_de')}%>

productPrice

<%${ecx:productCatalog('aaa-bbb-ccc','localizedProductPrices')['de']}%>

<%${ecx:productCatalog('aaa-bbb-ccc','productPrice_eur')}%>

msrp

<%${ecx:productCatalog('aaa-bbb-ccc','localizedMsrp')['eur']}%>

<%${ecx:productCatalog('aaa-bbb-ccc','msrp_eur')}%>

description

<%${ecx:productCatalog('aaa-bbb-ccc','localizedDescriptions')['de']}%>

<%${ecx:productCatalog('aaa-bbb-ccc','description_de')}%>

productURL

<%${ecx:productCatalog('aaa-bbb-ccc','localizedProductURLs')['de']}%>

<%${ecx:productCatalog('aaa-bbb-ccc','productURL_de')}%>

variant

<%${ecx:productCatalog('aaa-bbb-ccc','variant')['xl']}%>

<%${ecx:productCatalog('aaa-bbb-ccc','variant_xl')}%>


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

user.wishlistProducts

Abandoned cart

user.abandonedCartProducts

Abandoned browse

user.abandonedBrowseProducts

Transactions

user.transactionProducts

Recommended products

user.recommendedProducts

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

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

user.wishlistProductsRD['dataset']

Abandoned cart

user.abandonedCartProductsRD['dataset']

Abandoned browse

user.abandonedBrowseProductsRD['dataset']

Recommended products

user.recommendedProductsRD['dataset']

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>

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>