Step 6: Capture Site Conversions

The addPurchaseRows method sends information about the products that a customer has purchased to Monetate and specifies details about that product (for example, quantity, purchase ID, amount, and currency). Implementing this method call is important because it allows you to target experiences based on past purchases and also ensures Monetate can measure the success of experiences that you launch. Include the addPurchaseRows method on purchase confirmation pages.

For example, if you've implemented the addPurchaseRows method and want to run an experience based on a previously purchased product, configure the relevant data target, such as the previously purchased product equals "shoes," as part of the WHO settings of the experience.

Code ExampleTips
// addPurchaseRows Method
window.monetateQ.push([
  "addPurchaseRows", [{
    "purchaseId": "idString",
    "productId": "pidString",
    "quantity": "quantityString",
    "unitPrice": "priceString",
    "sku": "skuString",
    "currency": "currencyString"
  }]
]);
addPurchaseRows requires the following properties: purchaseId, productId, quantity, and unitPrice. Optional properties include currency and SKU. Non-US sites must include currency.

The purchaseId property must be the same across all rows within addPurchaseRows. The value it contains must be unique across visitors so that you can validate the implementation by matching purchases collected by Monetate with your own data.
// addPurchaseRows Example 
window.monetateQ = window.monetateQ || [];
window.monetateQ.push([
  "addPurchaseRows", [{
    "purchaseId": "73893797",
    "productId": "a123",
    "quantity": "1",
    "unitPrice": "99.99",
    "currency": "EUR"
  }, {
    "purchaseId": "73893797",
    "productId": "b345",
    "quantity": "3",
    "unitPrice": "29.99",
    "currency": "EUR"
  }]
]);
window.monetateQ.push([
  "trackData"
]);
The addPurchaseRows method only captures the product price and not separate delivery, tax, or promotion costs.