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': '{{Currency}}', // currency code used on a website RSD
- 'purchase': { // name of an action. In this case, always stays as purchase
- 'actionField': {
- 'id': '{{Order ID}}', // order id. required (The unique order ID of the transaction. Should match the actual ID of the order)
- 'affiliation': '{{affiliate code/name}}', // name of the affiliate. or affiliate id if exists. If your webshop don't have affiliate sales remove this parameter.
- 'revenue': '{{Transaction Revenue}}', // 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) CLTR - final payment ammout for this transaction.
- 'tax':'{{tax}}', // taxes (excluding shipping) (Tax paid. Same formatting instructions as with revenue.) 0.00
- 'shipping': '{{shipping}}', // shipping cost (Cost of shipping (Delivery). Same formatting instructions as with revenue.) 0.00
- 'coupon': '{{coupon voucher}}' // coupon code used in this transaction
- },
- 'products': [ // list of products a user has purchased
- {
- 'name': '{{product name}}', // name of a product
- 'id': '{{Product ID}}', // id (SKU) of a product (unique for each product)
- 'price': '{{product price}}', // price of a product (The price of one item. Same formatting instructions as with revenue for example 100.00)
- '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. devices/mobile-devices)
- 'variant': '{{PRODUCT VARIANT}}', // product variant. If there are no variants, exclude this key from the dataLayer.push
- 'quantity' : {{Product quantity 1}} // product quantity
- 'dimension20': '{{tariff}}', //optional. A Product-scoped Custom Dimension for index number N. If there are no variants, exclude this key from the dataLayer.push
- },
- {
- 'name': '{{product name 2}}', // name of a product
- 'id': '{{Product ID 2}}', // id (SKU) of a product (unique for each product)
- 'price': '{{product price 2}}', // price of a product (The price of one item. Same formatting instructions as with revenue for example 100.00)
- 'brand': '{{product brand 2}}', // brand/vendor of a product
- 'category': '{{Product Category 2}}', // Product category of the item. Can have maximum five levels of hierarchy. category/sub-category (ex. devices/mobile-devices)
- 'variant': '{{PRODUCT VARIANT 2}}', // product variant. If there are no variants, exclude this key from the dataLayer.push
- 'quantity' : {{Product quantity 2}} // product quantity
- 'dimension20': '{{tariff}}', //optional. A Product-scoped Custom Dimension for index number N. If there are no variants, exclude this key from the dataLayer.push
- },
- {
- 'name': '{{product name 3}}', // name of a product
- 'id': '{{Product ID 3}}', // id (SKU) of a product (unique for each product)
- 'price': '{{product price 3}}', // price of a product (The price of one item. Same formatting instructions as with revenue for example 100.00)
- 'brand': '{{product brand 3}}', // brand/vendor of a product
- 'category': '{{Product Category}}', // Product category of the item. Can have maximum five levels of hierarchy. category/sub-category (ex. devices/mobile-devices)
- 'variant': '{{PRODUCT VARIANT 3}}', // product variant. If there are no variants, exclude this key from the dataLayer.push
- 'quantity' : {{Product quantity 3}} // product quantity
- 'dimension20': '{{tariff}}', //optional. A Product-scoped Custom Dimension for index number N. If there are no variants, exclude this key from the dataLayer.push
- }]
- }
- }
- });
- </script>
Add Comment
Please, Sign In to add comment