Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //room name, transacion id and price, revenue, quanity data should be addedd. ask developer to make this code dynamic//
- //this code need to be addded in the confirmation page//
- <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
- 'purchase': { // name of an action. In this case, always stays as purchase
- 'actionField': {
- 'id': '155', // transaction id. required
- 'affiliation': 'affiliate', // name of the affiliate. or affiliate id
- 'revenue': '50.00', // order revenue without taxes
- 'coupon': 'cuponcode' // coupon code used in this transaction
- },
- 'products': [{ // list of rooms a user has purchased
- 'name': 'Private 8-bed Room', // name of a room that is currently viewed
- 'price': '330.00', // price of a room
- 'category': 'private', // category of a room//private, shared etc//
- 'quantity' : 1 // room quantity
- }]
- }
- }
- });
- </script>
Add Comment
Please, Sign In to add comment