SHOW:
|
|
- or go back to the newest paste.
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': 'main'}, // optional. if this event happened in a certain list, pass its name with this key | |
8 | - | 'products': [{ |
8 | + | 'products': [ // list of products a user has purchased |
9 | - | 'name': 'Citizen - SUPER TITANIUM. MODEL: AW0060-11P', // name of a product that is currently viewed. Always include it. |
9 | + | { |
10 | - | 'id': 'CIT30283', // id of a product. Always include it. |
10 | + | 'name': '{{restaurant - meal name ex DUCK & WAFFLE - CORN RIBS}}', // name of a product that is currently viewed. Upsell products - product name |
11 | - | 'price': '330.00', // price of a product |
11 | + | 'id': 'TBD (ex 123456)', // id (SKU) of a product (unique for each product for each of the restaurants) |
12 | - | 'brand': 'Citizen', // brand/vendor of a product |
12 | + | 'price': '7.00', // price of a product (The price of one item. Same formatting instructions as with revenue.) |
13 | - | 'category': 'Watches', // category of a product |
13 | + | 'brand': 'DUCK & WAFFLE', // brand/vendor of a product |
14 | - | 'variant': 'Silver' // product variant. If there are no variants, exclude this key from the dataLayer.push |
14 | + | '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) |
15 | - | }] |
15 | + | 'variant': '{{PRODUCT VARIANT ex Homeslice}}' // product variant. If there are no variants, exclude this key from the dataLayer.push |
16 | }, | |
17 | { | |
18 | 'name': 'TBD (restaurant - meal name ex DUCK & WAFFLE - BACON WRAPPED DATES | Two per order)', // name of a product that is currently viewed | |
19 | 'id': 'TBD (ex 123457)', // id (SKU) of a product (unique for each product for each of the restaurants) | |
20 | 'price': '10.00', // price of a product (The price of one item. Same formatting instructions as with revenue.) | |
21 | 'brand': 'DUCK & WAFFLE', // brand/vendor of a product | |
22 | 'category': 'DUCK & WAFFLE', // category of a product within restaurant menu | |
23 | 'variant': 'TBD' // product variant. If there are no variants, exclude this key from the dataLayer.push | |
24 | }, | |
25 | { | |
26 | 'name': 'TBD (restaurant - meal name ex DUCK & WAFFLE - CRISPY YELLOWTAIL TAQUITOS | Two per order)', // name of a product that is currently viewed | |
27 | 'id': 'TBD (ex 123458)', // id (SKU) of a product (unique for each product for each of the restaurants) | |
28 | 'price': '15.00', // price of a product (The price of one item. Same formatting instructions as with revenue.) | |
29 | 'brand': 'DUCK & WAFFLE', // brand/vendor of a product | |
30 | '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) | |
31 | 'variant': 'TBD' // product variant. If there are no variants, exclude this key from the dataLayer.push | |
32 | }] | |
33 | } | |
34 | } | |
35 | }); | |
36 | </script> |