addProducts

Use the addProducts method to add products that a site visitor views on index, product list, category list, or search results pages.

A product ID (PID) can have no more than 50 characters. The API call fails if any PID exceeds this limit.

Monetate Inspector Example

This screenshot shows the Components tab of the Monetate Inspector browser plug-in. The Product IDs row indicates that the addProducts method has passed multiple PID values.

The Components tab of Monetate Inspector, with product IDs in the Product IDs row

Code Samples

A pidString value can include letters and numbers. Whitespaces are not supported.

// addProducts Method
window.monetateQ.push([
  "addProducts", ["pidString",
    "pidString",
    "pidString"
  ]
]);
// addProducts Example
window.monetateQ = window.monetateQ || [];
window.monetateQ.push([
  "addProducts", ["a123",
    "b456",
    "c789",
    "d123",
    "e456"
  ]
]);
window.monetateQ.push([
  "trackData"
]);