dusanmiha

VIP - EEC - Product Detail View

Nov 26th, 2020 (edited)
85
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. window.dataLayer  = window.dataLayer || [];
  3. window.dataLayer.push({
  4.     'event': 'eec.productDetail',       // name of an event. In this case, always stays as eec.productDetail
  5.     'ecommerce': {                      // ecommerce object. This is the essential part of tracking. New EE data must always be pushed to this object
  6.         'detail': {                     // name of an action. In this case, always stays as detail
  7.           'actionField': {'list': '{{Product List Name}}'},    // optional. if this event happened in a certain list, pass its name with this key Examples: Telefoni, Gedžeti, TV/Laptop, Dodatna Oprema, Tableti/Konzole, Modemi i ruteri, Pretraga,
  8.           'products': [                   // list of products a user has purchased
  9.             {                  
  10.                 'name': '{{product name}}',      // name of a product that is currently viewed.
  11.                 'id': '{{product id}}',            // unique id (SKU) of a product
  12.                 'price': '{{product price}}',            // price of a product (The price of one item. The value must not include anything else except number separated by a decimal point. Don't use a comma as the separator, and don't include any currency symbols.)
  13.                 'brand': '{{product brand}}',           // brand/vendor of a product
  14.                 'category': '{{product category}}',      // Product category of the item. Can have maximum five levels of hierarchy. category/sub-category (ex. device/mobile-phone/samsung-galaxy20)
  15.                 'variant': '{{product variant}}',      // product variant. If there are no variants, exclude this key from the dataLayer.push. Example: color of the product.
  16.                 'dimensionN': '{{custom product attribute}}', //optional. A Product-scoped Custom Dimension for index number N. If there are no variants, exclude this key from the dataLayer.push
  17.                 'metricN': '{{custom product metric}}' //optional. A Product-scoped Custom Metric for index number N. If there are no variants, exclude this key from the dataLayer.push
  18.                 }]
  19.          }
  20.     }
  21. });
  22. </script>
RAW Paste Data