filipr27

GA4 - purchase online topup- a1v1

Feb 3rd, 2023 (edited)
191
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: 'purchase',
  4.   ecommerce: {
  5.     currency: 'RSD',                           //Required. Transaction Currency - Type: string
  6.     value: 200.00,                           //Transaction Revenue  - Type: number
  7.     tax: 0.00,                              //Transaction Tax - Type: number
  8.     shipping: 0.00,                            //Transaction Shipping - Type: number
  9.     affiliation: 'onlinetopup',               //Optional. Transaction Affiliation - Type: string
  10.     transaction_id: '1985_1675416726'                  //Required. Transaction ID - Type: string
  11.     items: [{
  12.       item_name: 'onlinetopup 200.00',     //Product Name - Type: string
  13.       item_id: 'dopuna200',          //Product ID/SKU - Type: string
  14.       price: 200.00,                              //Product price - Type: number
  15.       currency: 'RSD',                             //Currency of the price that is collected - Type: string
  16.       discount: 0.00,                              //Any discount associated with this product - Type: number
  17.       item_brand: 'A1',                   //Product Brand - Type: string  
  18.       item_category: 'dopuna',           //Product Category - Type: string
  19.       item_category2: 'dopuna200',            //Product Sub-Category 1 - Type: string
  20.       quantity: 1                                  //Product quantity - Type: number
  21.     }]
  22.   }
  23. });
Advertisement
Add Comment
Please, Sign In to add comment