dusanmiha

VIP - EEC - Purchase

Dec 2nd, 2020 (edited)
126
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.purchase',                // name of an event. In this case, always stays as eec.purchase
  5.     'ecommerce': {                          // ecommerce object. This is the essential part of tracking. New EE data must always be pushed to this object
  6.         'currencyCode': '{{Currency}}',             // currency code used on a website RSD
  7.         'purchase': {                       // name of an action. In this case, always stays as purchase
  8.             'actionField': {
  9.                 'id': '{{Order ID}}',                // order id. required (The unique order ID of the transaction. Should match the actual ID of the order)
  10.                 'affiliation': '{{affiliate code/name}}',   // name of the affiliate. or affiliate id if exists. If your webshop don't have affiliate sales remove this parameter.
  11.                 'revenue': '{{Transaction Revenue}}',         // order revenue without taxes (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) CLTR - final payment ammout for this transaction.
  12.                 'tax':'{{tax}}',                // taxes (excluding shipping) (Tax paid. Same formatting instructions as with revenue.) 0.00
  13.                 'shipping': '{{shipping}}',     // shipping cost (Cost of shipping (Delivery). Same formatting instructions as with revenue.) 0.00
  14.                 'coupon': '{{coupon voucher}}'      // coupon code used in this transaction
  15.             },
  16.             'products': [                   // list of products a user has purchased
  17.             {                  
  18.                 'name': '{{product name}}',      // name of a product
  19.                 'id': '{{Product ID}}',             // id (SKU) of a product (unique for each product)
  20.                 'price': '{{product price}}',           // price of a product (The price of one item. Same formatting instructions as with revenue for example 100.00)
  21.                 'brand': '{{product brand}}',           // brand/vendor of a product
  22.                 'category': '{{Product Category}}',     // Product category of the item. Can have maximum five levels of hierarchy. category/sub-category (ex. devices/mobile-devices)
  23.                 'variant': '{{PRODUCT VARIANT}}',       // product variant. If there are no variants, exclude this key from the dataLayer.push
  24.                 'quantity' : {{Product quantity 1}}             // product quantity
  25.                 'dimension20': '{{tariff}}', //optional. A Product-scoped Custom Dimension for index number N. If there are no variants, exclude this key from the dataLayer.push
  26.              },
  27.             {  
  28.                 'name': '{{product name 2}}',      // name of a product
  29.                 'id': '{{Product ID 2}}',           // id (SKU) of a product (unique for each product)
  30.                 'price': '{{product price 2}}',         // price of a product (The price of one item. Same formatting instructions as with revenue for example 100.00)
  31.                 'brand': '{{product brand 2}}',         // brand/vendor of a product
  32.                 'category': '{{Product Category 2}}',       // Product category of the item. Can have maximum five levels of hierarchy. category/sub-category (ex. devices/mobile-devices)
  33.                 'variant': '{{PRODUCT VARIANT 2}}',         // product variant. If there are no variants, exclude this key from the dataLayer.push
  34.                 'quantity' : {{Product quantity 2}}             // product quantity
  35.                 'dimension20': '{{tariff}}', //optional. A Product-scoped Custom Dimension for index number N. If there are no variants, exclude this key from the dataLayer.push
  36.              },
  37.             {  
  38.                 'name': '{{product name 3}}',      // name of a product
  39.                 'id': '{{Product ID 3}}',           // id (SKU) of a product (unique for each product)
  40.                 'price': '{{product price 3}}',         // price of a product (The price of one item. Same formatting instructions as with revenue for example 100.00)
  41.                 'brand': '{{product brand 3}}',         // brand/vendor of a product
  42.                 'category': '{{Product Category}}',     // Product category of the item. Can have maximum five levels of hierarchy. category/sub-category (ex. devices/mobile-devices)
  43.                 'variant': '{{PRODUCT VARIANT 3}}',         // product variant. If there are no variants, exclude this key from the dataLayer.push
  44.                 'quantity' : {{Product quantity 3}}             // product quantity
  45.                 'dimension20': '{{tariff}}', //optional. A Product-scoped Custom Dimension for index number N. If there are no variants, exclude this key from the dataLayer.push
  46.              }]
  47.         }  
  48.   }
  49. });
  50. </script>
RAW Paste Data