Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- window.dataLayer = window.dataLayer || [];
- window.dataLayer.push({
- 'event': 'eec.addToCart', // name of an event. In this case, always stays as eec.addToCart
- 'ecommerce': { // ecommerce object. This is the essential part of tracking. New EE data must always be pushed to this object
- 'currencyCode': '{{currency}}', // the currency which is currently used by a visitor RSD
- 'add': { // name of an action. In this case, always stays as add
- 'actionField': {
- 'list': '{{Product List Name}}' // optional. name of a list from which the product was added to a cart
- },
- 'products': [ // list of products a user has added to cart
- {
- 'name': '{{product name}}', // name of a product that is currently viewed
- 'id': '{{product ID}}', // unique id (SKU) of a product
- 'price': '{{product price}}', // price of a product (The price of one item. 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.)
- 'brand': '{{product brand}}', // brand/vendor of a product
- 'category': '{{product category}}', // Product category of the item. Can have maximum five levels of hierarchy. category/sub-category (ex. device/mobile-phone/samsung/galaxy20)
- 'variant': '{{product variant}}', // product variant. If there are no variants, exclude this key from the dataLayer.push
- 'quantity' : '{{product quantity}}, // product quantity
- 'dimension20': '{{device}}{{tariff}}', //optional. A Product-scoped Custom Dimension for index number N. If there are no variants, exclude this key from the dataLayer.push
- 'metricN': '{{custom product metric}}' //optional. A Product-scoped Custom Metric for index number N. If there are no variants, exclude this key from the dataLayer.push
- }]
- }
- }
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement