Advertisement
dusanmiha

Ecommerce Tracking

Jan 24th, 2022
995
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Push trialToPaid event to dataLayer when user upgrade their trial account to paid plan.
  2.  
  3. <script>
  4. window.dataLayer = window.dataLayer || [];
  5. dataLayer.push({
  6.  'event': 'trialToPaid',
  7.  'transactionId': '1234',                           // (Required)   Unique transaction identifier   string
  8.  'transactionTotal': 38.26,                         // (Required)   Total value of the transaction  numeric
  9.  'transactionProducts': [{
  10.    'sku': 'plan1',                                  // (Required)   Product SKU string
  11.    'name': 'Humango Fitness',                       // (Required)   Purchased plan Name string (Social, FItenss, Endurance, All-Star)
  12.    'category': 'Category 1',                        // (Optional)   Product category    string
  13.    'price': 11.99,                                  // (Required)   Unit price  numeric
  14.    'quantity': 1                                    // (Required)   Number of items numeric
  15.  }]
  16. });
  17. </script>
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement