Step 3: Capture Products on List Pages

The addProducts method sends to Monetate the product IDs and, optionally, the product SKUs that are rendered on an index or search page (for example, fifthlevelfashion.com/men/shirts.html). Because it enables you to target experiences at the product level on index and search pages, you must include this method in the page template for all index and search results pages.

For example, you want to show an action on a product index or search page. To accomplish this goal, you use the On index page action condition. This setup means that when you use this action condition, the action appears only on any index or search page on which those product IDs exist.

Sending both product IDs and product SKUs enhances the capabilities of recommendations and product-badging actions.

Code ExampleTips
// addProducts Method
window.monetateQ.push([
  "addProducts", [{
      "productId": "pidString1",
      "sku": "optionalSkuString1"
    },
    {
      "productId": "pidString2",
      "sku": "optionalSkuString2"
    },
    {
      "productId": "pidString3",
      "sku": "optionalSkuString3"
    }
  ]
]);
Product SKUs or IDs cannot exceed 50 characters.

If you have facet or filter functionality on a page that updates with AJAX or changes state asynchronously to display new data, you must add a retrack to ensure Monetate receives the changing product IDs on the page. Refer to AJAX Site Updates for more information.
 
// addProducts Example 
window.monetateQ = window.monetateQ || [];
window.monetateQ.push([
      "addProducts", [{
          "productId": "pidString1",
          "sku": "optionalSkuString1"
        },
        {
          "productId": "pidString2",
          "sku": "optionalSkuString2"
        },
        {
          "productId": "pidString3",
          "sku": "optionalSkuString3"
        }
      ]
      window.monetateQ.push([
        "trackData"
      ]);
The addProducts method doesn't trigger the product behavioral WHO targets. These are sourced via the addProductDetails, addCartRows, and addPurchaseRowsmethods.