Purchase Page Example

The purchase page of your site is the purchase confirmation page that appears after a customer completes a transaction.

Example of an online retailer's purchase confirmation page

The purchase page has the method setPageType with the value of purchase. The addPurchaseRows method is also present and contains the same information as the addCartRows method, except that when the trackData method sends the collected data to Monetate, it indicates that the customer made the purchase rather than just putting one or more products into their cart.

Code Samples

// Purchase Page Example
window.monetateQ = window.monetateQ || [];
window.monetateQ.push(["setPageType", "purchase"]);
window.monetateQ.push(["addPurchaseRows", [{
  "purchaseId": "00004001",
  "productId": "750518703299",
  "quantity": 1,
  "unitPrice": "299.99",
  "currency": "USD"
}]]);
window.monetateQ.push(["trackData"]);
// Purchase Page Example with a Discount
window.monetateQ.push([
  "addPurchaseRows", [{
    "purchaseId": "73893797",
    "productId": "a123",
    "quantity": "1",
    "unitPrice": "99.99",
    "currency": "EUR"
  }, {
    "purchaseId": "73893797",
    "productId": "DISCOUNT",
    "quantity": "1",
    "unitPrice": "-19.99",
    "currency": "EUR"
  }]
]);

Using Discount Codes

Monetate doesn't support discount codes on your site out of the box. However, you can take a few steps to track and report on this data.

  • Use a product ID called DISCOUNT with a quantity of 1and a negative price to reflect the discount.

    If the cart value is negative after the discount code, this situation may cause reports to display sales/transactions with negative values and thus possibly skew numbers within your reports.

  • Treat the discount or promotion as a line item within the cart and report it as such. If a discount or promotion affects cart items and not the total, ensure the price that you push to Monetate is the discounted price and not the original price. By pushing the discount price, you avoid having to also send a DISCOUNT line.

Monetate Inspector Example

To verify that you've correctly integrated your site's purchase page, launch the Monetate Inspector browser plug-in. If the page type has been implemented successfully, you see purchase in the Page Type row.

The Components tab of Monetate Inspector, with purchase in the 'Page Type' row and a value in the Purchase ID row