Help Centre

<

Home
Tracking product views for custom installation

To successfully install Salesfire on a bespoke platform, please follow the guides below to ensure all key events such as purchases, product views, and basket activity are tracked correctly. Completing these steps will enable a smooth and fully optimised custom integration.

  1. Tracking product purchases for custom installation
  2. Tracking product views for custom installation
  3. Custom basket tracking for Abandoned Orders

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 >.