Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- // Send transaction data with a pageview if available
- // when the page loads. Otherwise, use an event when the transaction
- // data becomes available.
- dataLayer.push({
- 'ecommerce': {
- 'purchase': {
- 'actionField': {
- 'id': '{{ bill.trans_id }}', // Transaction ID. Required for purchases and refunds.
- {# 'affiliation': 'Online Store',#}
- 'revenue': '{{ order.ttc }}', // Total transaction value (incl. tax and shipping)
- 'tax':'{{ vat }}',
- 'shipping': '0',
- 'coupon': ''
- },
- 'products': [{ // List of productFieldObjects.
- 'name': '{{ order.offer.name }}', // Name or ID is required.
- 'id': '{{ order.offer.id }}',
- 'price': '{{ order.ttc }}',
- 'quantity': {{ order.duration }},
- 'coupon': '' // Optional fields may be omitted or set to empty string.
- }]
- }
- }
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement