Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. window.dataLayer = window.dataLayer || []; // use an event when the transaction data becomes available.
  2. window.dataLayer.push({
  3. 'event': 'purchase',
  4. 'ecommerce': {
  5. 'currencyCode': 'GBP',
  6. 'purchase': {
  7. 'actionField': {
  8. 'id': 'WEB-121237', // Transaction ID. Required for purchases
  9. 'affiliation': 'Suck UK',
  10. 'revenue': '33.50', // Total transaction value (incl. tax and shipping)
  11. 'tax':'0.00',
  12. 'shipping': '21.00'
  13. },
  14. 'products': [{ // adjust product array according to the order data
  15. 'name': 'Stress-Ball Paul',
  16. 'id': 'SK DEADPAUL1',
  17. 'price': '7.50',
  18. 'brand': '', //if brand is not applicable, just use empty string
  19. 'category': '',
  20. 'quantity': 1
  21. },
  22. {
  23. 'name': 'Cable Holder',
  24. 'id': 'GW CABLEHOLDER1',
  25. 'price': '5.00',
  26. 'brand': '', //if brand is not applicable, just use empty string
  27. 'category': '',
  28. 'quantity': 1
  29. }]
  30. }
  31. }
  32. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement