SHOW:
|
|
- or go back to the newest paste.
1 | window.dataLayer = window.dataLayer || []; | |
2 | window.dataLayer.push({ | |
3 | - | event: 'view_item_list', // name of the event. In this case, it always must be view_item_list |
3 | + | event: 'purchase', // name of the event. In this case, it always must be purchase |
4 | - | ecommerce: { |
4 | + | ecommerce: { |
5 | - | items: [{ |
5 | + | currency: 'EUR', |
6 | - | item_name: 'Alpecin-Fenix Sweatpants 2022', // insert a product name |
6 | + | value: '99.8', |
7 | - | item_id: 'CIT30283', // insert an actual product ID |
7 | + | tax: '12.00', |
8 | shipping: '4.95', | |
9 | transaction_id: '45734', | |
10 | - | item_category: 'Team Alpecin - Fenix', // category of a product |
10 | + | customer_email: 'test@example.com', // customer email |
11 | - | item_category2: 'Sweatpants', // subcategory of a product (type of clothing) |
11 | + | customer_telephone: '+32494222436', // customer telephone number (must always contain country code) |
12 | - | item_variant: 'L', // variant of a product, if there are no variants, exclude this key from the dataLayer.push |
12 | + | coupon: 'blackfriday', |
13 | - | item_list_name: 'Shop overview' |
13 | + | items: [{ |
14 | - | index: 1 |
14 | + | item_name: 'Alpecin-Fenix Sweatpants 2022', // insert a product name |
15 | - | quantity: '1' // always '1' |
15 | + | item_id: 'CIT30283', // insert an actual product ID |
16 | price: '49.90', // insert an actual product price. Number or a string. Don't include currency code | |
17 | item_brand: 'FDMKR', | |
18 | item_category: 'Team Alpecin - Fenix', // category of a product | |
19 | item_category2: 'Sweatpants', // subcategory of a product (type of clothing) | |
20 | item_variant: 'L', // variant of a product, if there are no variants, exclude this key from the dataLayer.push | |
21 | quantity: '1' | |
22 | },{ | |
23 | item_name: 'Twisted hoodie', // insert a product name | |
24 | - | item_list_name: 'Related products' // Shop overview vs. related products |
24 | + | |
25 | - | index: 1 |
25 | + | |
26 | - | quantity: '1' // always '1' |
26 | + | |
27 | item_category: 'Lifestyle', // category of a product | |
28 | item_category2: 'Hoodie', // subcategory of a product (type of clothing) | |
29 | item_variant: 'S', // variant of a product, if there are no variants, exclude this key from the dataLayer.push | |
30 | quantity: '1' | |
31 | }] | |
32 | } | |
33 | }); |