Advertisement
CharlotteVDB

GA4 - EEC - Purchase - FDMKR

Nov 29th, 2022 (edited)
669
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: '99.8',
  7.       tax: '12.00',
  8.       shipping: '4.95',
  9.       transaction_id: '45734',
  10.       customer_email: 'test@example.com',           // customer email
  11.       customer_telephone: '+32494222436',           // customer telephone number (must always contain country code)  
  12.       coupon: 'blackfriday',
  13.       items: [{
  14.          item_name: 'Alpecin-Fenix Sweatpants 2022',            // insert a product name
  15.          item_id: 'CIT30283',                       // insert an actual product ID
  16.          price: '49.90',  // insert an actual product price. Number or a string. Don't include currency code
  17.          item_brand: 'FDMKR',          
  18.          item_category: 'Team Alpecin - Fenix',         // category of a product
  19.          item_category2: 'Sweatpants',          // subcategory of a product (type of clothing)
  20.          item_variant: 'L',         // variant of a product, if there are no variants, exclude this key from the dataLayer.push
  21.          quantity: '1'                     
  22. },{
  23.       item_name: 'Twisted hoodie',          // insert a product name
  24.       item_id: 'CIT30284',                      // insert an actual product ID
  25.       price: '49.90',                   // insert an actual product price. Number or a string. Don't include currency code
  26.       item_brand: 'FDMKR',         
  27.       item_category: 'Lifestyle',           // category of a product
  28.       item_category2: 'Hoodie',         // subcategory of a product (type of clothing)
  29.       item_variant: 'S',        // variant of a product, if there are no variants, exclude this key from the dataLayer.push
  30.       quantity: '1'                    
  31.     }]
  32.   }
  33. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement