Created
January 14, 2016 07:01
-
-
Save hanafiah/003c86cf8de7fb77f43e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function beli() { | |
dataLayer.push({ | |
'event': 'GTM.beli', | |
'ecommerce': { | |
'purchase': { | |
'actionField': { | |
'id': 'T12345', // Transaction ID. Required for purchases and refunds. | |
'affiliation': 'Online Store', | |
'revenue': '35.43', // Total transaction value (incl. tax and shipping) | |
'tax':'4.90', | |
'shipping': '5.99', | |
'coupon': 'SUMMER_SALE' | |
}, | |
'products': [{ // List of productFieldObjects. | |
'name': 'Triblend Android T-Shirt', // Name or ID is required. | |
'id': '12345', | |
'price': '15.25', | |
'brand': 'Google', | |
'category': 'Apparel', | |
'variant': 'Gray', | |
'quantity': 1, | |
'coupon': '' // Optional fields may be omitted or set to empty string. | |
}, | |
{ | |
'name': 'Donut Friday Scented T-Shirt', | |
'id': '67890', | |
'price': '33.75', | |
'brand': 'Google', | |
'category': 'Apparel', | |
'variant': 'Black', | |
'quantity': 1 | |
}] | |
} | |
} | |
}); | |
} | |
beli(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment