Skip to content

Event codes for e‑commerce

Before implementing the event codes, the pixel embed script should be added on every page of the website. Instruction

The expected data types for the parameters are outlined on the page:
Available events and required parameters

View ‑ all pages

Insert on: the homepage and all other subpages of the site. What it handles: general script to be included on the entire website, analytical event. Triggered on init.
<script>
  wph('track', 'ViewContent', { content_name: 'View' });
</script>

ProductList ‑ product listing page

Insert on: category pages, product listings, product or service directories, homepage if product listing blocks are present (does not include recommendation widgets). What it handles: sends product lists for a given category, including their prices, names, and product IDs. Triggered on init.
<script>
  wph('track', 'ViewContent', {
    content_name: 'ProductList',
    currency: 'CURRENCY', // e.g. 'PLN', 'EUR'
    contents: [
      {
        id: 'PRODUCT_ID1', // type text e.g. 'SUP1234', '878-3939', 'abcd-xyz'
        name: 'PRODUCT_NAME1', // e.g. 'Super blue dress'
        category: 'PRODUCT_CATEGORY1', // e.g. 'Dress'
        price: PRODUCT_PRICE1 // type number e.g. 19.45
      },
      {
        id: 'PRODUCT_ID2',
        name: 'PRODUCT_NAME2',
        category: 'PRODUCT_CATEGORY2',
        price: PRODUCT_PRICE2
      },
    ],
  });
</script>

ViewProduct ‑ product page

Insert on: product or service detail pages. What it handles: sends data about the product, especially its ID, price, name, and category. Triggered on init.
<script>
  wph('track', 'ViewContent', {
    content_name: 'ViewProduct',
    currency: 'CURRENCY',
    contents: [
      {
        id: 'PRODUCT_ID1',
        name: 'PRODUCT_NAME1',
        category: 'PRODUCT_CATEGORY1',
        price: PRODUCT_PRICE1
      },
    ],
  });
</script>

AddToCart ‑ adding a product to the cart

Insert on: everywhere a product or service can be added to the cart (product pages, listings, category pages). What it handles: sends data about the selected product, including ID, price, name, and category. Triggered at the moment of adding to the cart (button click or event request).
<script>
  wph('track', 'AddToCart', {
    currency: 'CURRENCY',
    contents: [
      {
        id: 'PRODUCT_ID1',
        name: 'PRODUCT_NAME1',
        category: 'PRODUCT_CATEGORY1',
        price: PRODUCT_PRICE1,
        quantity: PRODUCT_QUANTITY1
      },
    ],
  });
</script>

Purchase ‑ order confirmation page (post‑transaction)

Insert on: purchase confirmation page (checkout success/done), or if not available, on the order confirmation page even before redirecting to the payment gateway. What it handles: sends transaction data, particularly product details, transaction ID, cart value, shipping cost, etc. Triggered on init or via event request.
<script>
  wph('track', 'Purchase', {
    transaction_id: 'TRANSACTION_ID', // type text e.g. 'SUP1234', '878-3939', 'abcd-xyz'
    value: NET_VALUE_EXCLUDING_SHIPPING_COST, // type number e.g. 19.99
    value_gross: GROSS_VALUE_EXCLUDING_SHIPPING_COST, // type number e.g. 23.59
    shipping_cost: SHIPPING_COST, // type number e.g. 9.99
    currency: 'CURRENCY',
    contents: [
      {
        id: 'PRODUCT_ID1',
        name: 'PRODUCT_NAME1',
        category: 'PRODUCT_CATEGORY1',
        price: PRODUCT_PRICE1,
        quantity: PRODUCT_QUANTITY1
      },
      {
        id: 'PRODUCT_ID2',
        name: 'PRODUCT_NAME2',
        category: 'PRODUCT_CATEGORY2',
        price: PRODUCT_PRICE2,
        quantity: PRODUCT_QUANTITY2
      },
    ],
  });
</script>

AddToWishList ‑ adding product to wishlist ‑ helper event

Insert on: wherever there’s an option to add a product or service to the favorites list (product pages, listings, category pages). What it handles: sends data about the selected product, especially ID, price, name, and category, or may be empty—then it serves as an analytical event. Triggered at the moment of adding to favorites (click or event request).
<script>
  wph('track', 'ViewContent', {
    content_name: 'AddToWishList',
    currency: 'CURRENCY',
    contents: [
      {
        id: 'PRODUCT_ID1',
        name: 'PRODUCT_NAME1',
        category: 'PRODUCT_CATEGORY1',
        price: PRODUCT_PRICE1
      },
    ],
  });
</script>

RemoveFromWishList ‑ removing product from wishlist ‑ helper event

Insert on: wherever there’s an option to remove a product or service from favorites (product pages, listings, category pages, favorites page). What it handles: sends data about the removed product, especially ID, price, name, and category, or may be empty—then it serves as an analytical event. Triggered at the moment of removing from favorites (click or event request).
<script>
  wph('track', 'ViewContent', {
    content_name: 'RemoveFromWishList',
    currency: 'CURRENCY',
    contents: [
      {
        id: 'PRODUCT_ID1',
        name: 'PRODUCT_NAME1',
        category: 'PRODUCT_CATEGORY1',
        price: PRODUCT_PRICE1
      },
    ],
  });
</script>

WishList ‑ adding product to the cart which was previously added to wishlist ‑ conversion event

Insert on: wherever there’s an option to add a product or service to the cart (product pages, listings, category pages). What it handles: sends data about the selected product, especially ID, price, name, and category. Triggered at the moment of adding to the cart a product that was previously added to favorites (click or event request).
<script>
  wph('track', 'Conversion', {
    content_name: 'WishList',
    currency: 'CURRENCY',
    contents: [
      {
        id: 'PRODUCT_ID1',
        name: 'PRODUCT_NAME1',
        category: 'PRODUCT_CATEGORY1',
        price: PRODUCT_PRICE1
      },
    ],
  });
</script>
Frequently Asked Questions (FAQ)
Data is not being collected properly or there are issues with the Pixel functioning

Make sure that, for example, 'PRODUCT_ID1' is always automatically replaced with the actual product ID on every page — entering it literally will cause malfunction.