addProductDetails

Use the addProductDetails method to add items when a customer views a more detailed product description on a product detail page. This type of page is usually linked from an index or search page thumbnail. Some product detail pages may have several items described.

A product ID (PID) can have a maximum of 50 characters. Any PID that exceeds this length is truncated after 50 characters.

Monetate Inspector Example

This screenshot shows the Components tab of the Monetate Inspector browser plug-in. The Products row indicates that the addProductDetails method has passed PID values as well as product SKU values.

Although both PID and SKU are required in a product catalog, you're only required to implement method calls for PID. You should implement SKU if you intend to use recommendations or target by SKU.

Older deployments may require a script update to add SKU support for the method. Contact your Services team for more information.

The Components tab of Monetate Inspector, with product in the Page Type row and both product IDs and product SKUs in the Products row

Code Samples

// addProductDetails Method
window.monetateQ.push([
  "addProductDetails", ["pidString", "pidString", "pidString"]
]);
// addProductDetails Example
window.monetateQ = window.monetateQ || [];
window.monetateQ.push([
  "addProductDetails", ["a123"]
]);
window.monetateQ.push([
  "trackData"
]);

Single SKU Example

window.monetateQ = window.monetateQ || [];
window.monetateQ.push([
  "addProductDetails", [{
    productId: "pidString",
    sku: "skuString"
  }]
]);
window.monetateQ.push([
  "trackData"
]);

Multiple SKUs Example

window.monetateQ = window.monetateQ || [];
window.monetateQ.push([
  "addProductDetails", [
  {
    productId: "pidString",
    sku: "skuString_01"
  },
  {
    productId: "pidString",
    sku: "skuString_02"
  },
  {
    productId: "pidString",
    sku: "skuString_03"
  }]
]);
window.monetateQ.push([
  "trackData"
]);