Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.dataLayer = window.dataLayer || []; // use an event when the transaction data becomes available.
- window.dataLayer.push({
- 'event': 'purchase',
- 'ecommerce': {
- 'currencyCode': 'GBP',
- 'purchase': {
- 'actionField': {
- 'id': 'WEB-121237', // Transaction ID. Required for purchases
- 'affiliation': 'Suck UK',
- 'revenue': '33.50', // Total transaction value (incl. tax and shipping)
- 'tax':'0.00',
- 'shipping': '21.00'
- },
- 'products': [{ // adjust product array according to the order data
- 'name': 'Stress-Ball Paul',
- 'id': 'SK DEADPAUL1',
- 'price': '7.50',
- 'brand': '', //if brand is not applicable, just use empty string
- 'category': '',
- 'quantity': 1
- },
- {
- 'name': 'Cable Holder',
- 'id': 'GW CABLEHOLDER1',
- 'price': '5.00',
- 'brand': '', //if brand is not applicable, just use empty string
- 'category': '',
- 'quantity': 1
- }]
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement