filipr27

GA4 - purchase - next

Jun 1st, 2022
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. window.dataLayer = window.dataLayer || [];
  2. window.dataLayer.push({
  3.   event: 'ga4_purchase',
  4.   reorder: 'true',  // Varaible value. 'true' - if the order is a reorder, 'false' - if the order is not a reorder.
  5.   ecommerce: {
  6.     currency: 'USD',                           //Required. Transaction Currency - Type: string
  7.     value: 8400.90,                           //Transaction Revenue  - Type: number
  8.     tax: 525.06,                               //Transaction Tax - Type: number
  9.     shipping: 0.00,                            //Transaction Shipping - Type: number
  10.     transaction_id: 'abc123',                  //Required. Transaction ID - Type: string
  11.     coupon: 'coupon',                          //The coupon name/code associated with the event - Type: string
  12.     items: [{
  13.       item_name: 'ECLIPSE Blackoil Reservoir Simulation',        //Product Name - Type: string
  14.       item_id: '71274',                                //Product ID/SKU - Type: string
  15.       price: 4000.00,                                  //Product price - Type: number
  16.       currency: 'USD',                                 //Currency of the price that is collected - Type: string
  17.       discount: 0.00,                                  //Any discount associated with this product - Type: number
  18.       item_brand: 'Oil and Gas Software',              //Product Brand - Type: string  
  19.       item_category: 'Schlumberger Software',          //Product Category - Type: string
  20.       item_category2: 'Indonesia',                     //Product Sub-Category 1 - Type: string
  21.       item_category3: 'Jakarta',                       //Product Sub-Category 2 - Type: string
  22.       item_variant: 'Foundation',                      //Variant of the product - variant SKU/ID - Type: string
  23.       quantity: 1                                      //Product quantity - Type: number
  24.     },{
  25.       // Another item.
  26.     }]
  27.   }
  28. });
Advertisement
Add Comment
Please, Sign In to add comment