Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- window.dataLayer = window.dataLayer || [];
- window.dataLayer.push({
- 'event': 'eec.purchase', // name of an event. In this case, always stays as eec.purchase
- 'ecommerce': { // ecommerce object. This is the essential part of tracking. New EE data must always be pushed to this object
- 'currencyCode': 'GBP', // currency code used on a website
- 'purchase': { // name of an action. In this case, always stays as purchase
- 'actionField': {
- 'id': 'Order123', // order id. required (The unique order ID of the transaction. Should match the actual ID of the order)
- 'affiliation': 'affiliate', // name of the affiliate. or affiliate id
- 'revenue': '102.00', // 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)
- 'tax':'TBD', // taxes (excluding shipping) (Tax paid. Same formatting instructions as with revenue.)
- 'shipping': '7', // shipping cost (Cost of shipping (Delivery). Same formatting instructions as with revenue.)
- 'coupon': 'TBD' // coupon code used in this transaction
- },
- 'products': [ // list of products a user has purchased
- {
- 'name': '{{restaurant - meal name ex DUCK & WAFFLE - CORN RIBS}}', // name of a product that is currently viewed. Upsell products - product name
- 'id': 'TBD (ex 123456)', // id (SKU) of a product (unique for each product for each of the restaurants)
- 'price': '7.00', // price of a product (The price of one item. Same formatting instructions as with revenue.)
- 'brand': 'DUCK & WAFFLE', // brand/vendor of a product
- 'category': 'DUCK & WAFFLE/DUCK & WAFFLE', // Product category of the item. Can have maximum five levels of hierarchy. restaurant/sub-menu-category (ex. clothes/shirts/t-shirts)
- 'variant': '{{PRODUCT VARIANT ex Homeslice}}', // product variant. If there are no variants, exclude this key from the dataLayer.push
- 'quantity' : 1 // product quantity
- },
- {
- 'name': 'TBD (restaurant - meal name ex DUCK & WAFFLE - BACON WRAPPED DATES | Two per order)', // name of a product that is currently viewed
- 'id': 'TBD (ex 123457)', // id (SKU) of a product (unique for each product for each of the restaurants)
- 'price': '10.00', // price of a product (The price of one item. Same formatting instructions as with revenue.)
- 'brand': 'DUCK & WAFFLE', // brand/vendor of a product
- 'category': 'DUCK & WAFFLE', // category of a product within restaurant menu
- 'variant': 'TBD', // product variant. If there are no variants, exclude this key from the dataLayer.push
- 'quantity' : 2 // product quantity
- },
- {
- 'name': 'TBD (restaurant - meal name ex DUCK & WAFFLE - CRISPY YELLOWTAIL TAQUITOS | Two per order)', // name of a product that is currently viewed
- 'id': 'TBD (ex 123458)', // id (SKU) of a product (unique for each product for each of the restaurants)
- 'price': '15.00', // price of a product (The price of one item. Same formatting instructions as with revenue.)
- 'brand': 'DUCK & WAFFLE', // brand/vendor of a product
- 'category': 'SUSHISAMBA SMALL PLATES', // Product category of the item. Can have maximum five levels of hierarchy. restaurant/sub-menu-category (ex. clothes/shirts/t-shirts)
- 'variant': 'TBD', // product variant. If there are no variants, exclude this key from the dataLayer.push
- 'quantity' : 5 // product quantity
- }]
- }
- }
- });
- </script>
Add Comment
Please, Sign In to add comment