CharlotteVDB

GA4 - purchase - Foodmaker

Aug 9th, 2023 (edited)
1,270
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',           // name of the event. In this case, it always must be purchase
  4.    ecommerce: {        
  5.       currency: 'EUR',
  6.       value: '130.80',
  7.       shipping: '10.00'
  8.       transaction_id: 'xxx',                    // insert an actual transaction ID
  9.       customer_email: '[email protected]',           // customer email
  10.       customer_telephone: '+32494222436',           // customer telephone number (must always contain country code)  
  11.       coupon: 'blackfriday',
  12.       items: [{
  13.          item_name: 'Big Bowl poke chicken',            // insert a product name
  14.          item_id: 'xxx',                        // insert an actual product ID
  15.          price: '7.90',  // insert an actual product price. Number or a string. Don't include currency code
  16.          item_brand: 'Foodmaker',          
  17.          item_category: 'Foodmaker box',        // category of a product (Foodmaker box vs. Back on Track vs. Gift card)
  18.          item_category2: 'Zelf samenstellen',           // subcategory of a product (Vaste inhoud vs. zelf samenstellen)
  19.          item_category3: 'Big bowl',            // subcategory of a product (Categorie van het gerecht)
  20.          item_category4: 'Non veggie',          // non veggie vs. veggie vs. vegan
  21.          quantity: '2'                     
  22. },{
  23.          item_name: 'Back on Track - 1 week - 1200 kcal',           // insert a product name
  24.          item_id: 'xxx',                        // insert an actual product ID
  25.          price: '105.00',               // insert an actual product price. Number or a string. Don't include currency code
  26.          item_brand: 'Foodmaker',          
  27.          item_category: 'Back on Track',        // category of a product (Foodmaker box vs. Back on Track vs. Gift card)
  28.          item_category2: '1 week - 1200 kcal',          // (aantal weken - aantal kcal)
  29.          quantity: '1'                     
  30.     }]
  31.   }
  32. });
Advertisement
Add Comment
Please, Sign In to add comment