Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var dataLayer = window.dataLayer || [];
- dataLayer.push({
- 'event': 'transaction',
- 'ecommerce': {
- 'purchase': {
- 'actionField': {
- 'id': 'T12345', // Transaction ID. Required
- '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': 'T-Shirt 2', // Name or ID is required.
- 'id': '12345',
- 'price': '15.25',
- 'brand': 'Measureschool',
- 'category': 'Shirts',
- 'variant': 'Gray',
- 'quantity': 1,
- 'coupon': '' // Optional fields may be omitted or set to empty string.
- },
- {
- 'name': 'T-Shirt 1',
- 'id': '67890',
- 'price': '33.75',
- 'brand': 'Measureschool',
- 'category': 'Shirts',
- 'variant': 'Black',
- 'quantity': 1
- }] //expand this array if more product exists
- }
- }
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement