Skip to content

Product Details Page

trackProductDetailsViewed()

Call on product detail pages.

javascript
(async function () {
  await new Promise(function (resolve) {
    if (window.AffiliateSDK) return resolve();
    var interval = setInterval(function () {
      if (window.AffiliateSDK) {
        clearInterval(interval);
        resolve();
      }
    }, 50);
  });

  await window.AffiliateSDK.trackProductDetailsViewed({
    product: {
      productId: "PROD-001",
      name: "Running Shoes",
      price: 44.99,
    },
  });
})();

Released under the MIT License.