Help Centre

<

Home
Tracking product views for custom installation

This tracking is required to make use of our Product Views prompt.

You need to insert the following code on product pages and ensure the fields reflect the current product being viewed.

<script>
  window.sfDataLayer = window.sfDataLayer || [];
  window.sfDataLayer.push({
      "ecommerce": {
          "view": {
              "sku": "220165", // parent product sku
              "name": "Product Title",
              "variant": "Color: Red, Size: Small",
              "price": 25.00, // ex tax price
              "currency": "GBP"
          }
      }
  });
</script>

Field definitions

  • Sku (Required) - This is the parent product ID. For example, the parent ID of a product.
  • Name (Recommended) - The name of the product.
  • Variant (Recommended) - The name of the variant.
  • Price (Recommended) - The price of the product excluding tax.
  • Currency (Recommended) - The currency of the product's price.
  • Brand (Optional) - The name of the brand.
  • Category (Optional) - A comma separated list of categories. Nested categories should be denoted by a >.