dusanmiha

GA4 - view_cart

Oct 6th, 2021 (edited)
616
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: 'view_cart',
  4.   ecommerce: {
  5.     items: [{
  6.       item_name: 'Product 1',                    //Product Name - Type: string
  7.       item_id: 'mp1122',                        //Product ID/SKU - Type: string
  8.       price: '31.10',                           //Product price - Type: numeric
  9.       item_brand: 'product brand',              //Product Brand- Type: string  
  10.       item_category: 'Apparel',                 //Product Category - Type: string
  11.       item_category2: 'Coats',                  //Product Sub-Category 1 - Type: string
  12.       item_category3: 'Wool',                   //Product Sub-Category 2 - Type: string
  13.       item_category4: 'Unisex',                 //Product Sub-Category 3 - Type: string
  14.       item_category5: 'cat5',                 //Product Sub-Category 4 - Type: string
  15.       item_variant: 'Navy blue',                //Variant of other product like size, color et c - Type: string
  16.       quantity: '3'                             //Product quantity - Type: integer
  17.     },{
  18.       item_name: 'Parka stain removal',
  19.       item_id: 'psr1332',
  20.       price: '5.99',
  21.       item_brand: 'product brand',
  22.       item_category: 'Apparel',
  23.       item_category2: 'Utility',
  24.       item_category3: 'Care product',
  25.       item_category4: 'Unisex',                
  26.       item_category5: 'cat5',
  27.       quantity: '1'
  28.     }]
  29.   }
  30. });
Advertisement
Add Comment
Please, Sign In to add comment