Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- window.dataLayer = window.dataLayer || [];
- window.dataLayer.push({
- 'event': 'eec.productDetail', // name of an event. In this case, always stays as eec.productDetail
- 'ecommerce': { // ecommerce object. This is the essential part of tracking. New EE data must always be pushed to this object
- 'detail': { // name of an action. In this case, always stays as detail
- 'actionField': {'list': 'main'}, // optional. if this event happened in a certain list, pass its name with this key
- '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
- },
- {
- '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
- },
- {
- '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
- }]
- }
- }
- });
- </script>
Add Comment
Please, Sign In to add comment