SHARE
TWEET

Untitled

a guest Oct 21st, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. dataLayer.push({
  3.   'event': 'transaction',
  4.   'ecommerce': {
  5.     'purchase': {
  6.       'actionField': {
  7.         'id': 'T12345',        // Transaction ID. Required          
  8.         'affiliation': 'Online Store',
  9.         'revenue': '35.43',   // Total transaction value (incl. tax and shipping)
  10.         'tax':'4.90',
  11.         'shipping': '5.99',
  12.         'coupon': 'SUMMER_SALE'
  13.       },
  14.       'products': [{          // List of productFieldObjects.
  15.         'name': 'T-Shirt 2',  // Name or ID is required.
  16.         'id': '12345',
  17.         'price': '15.25',
  18.         'brand': 'Measureschool',
  19.         'category': 'Shirts',
  20.         'variant': 'Gray',
  21.         'quantity': 1,
  22.         'coupon': ''  // Optional fields may be omitted or set to empty string.
  23.        },
  24.        {
  25.         'name': 'T-Shirt 1',
  26.         'id': '67890',
  27.         'price': '33.75',
  28.         'brand': 'Measureschool',
  29.         'category': 'Shirts',
  30.         'variant': 'Black',
  31.         'quantity': 1
  32.        }] //expand this array if more product exists
  33.     }
  34.   }
  35. });
  36.  
  37. </script>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top