Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2016
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. <script>
  2. // Send transaction data with a pageview if available
  3. // when the page loads. Otherwise, use an event when the transaction
  4. // data becomes available.
  5. dataLayer.push({
  6. 'ecommerce': {
  7. 'purchase': {
  8. 'actionField': {
  9. 'id': '{{ bill.trans_id }}', // Transaction ID. Required for purchases and refunds.
  10. {# 'affiliation': 'Online Store',#}
  11. 'revenue': '{{ order.ttc }}', // Total transaction value (incl. tax and shipping)
  12. 'tax':'{{ vat }}',
  13. 'shipping': '0',
  14. 'coupon': ''
  15. },
  16. 'products': [{ // List of productFieldObjects.
  17. 'name': '{{ order.offer.name }}', // Name or ID is required.
  18. 'id': '{{ order.offer.id }}',
  19. 'price': '{{ order.ttc }}',
  20. 'quantity': {{ order.duration }},
  21. 'coupon': '' // Optional fields may be omitted or set to empty string.
  22. }]
  23. }
  24. }
  25. });
  26. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement