Advertisement
Jawad_Khan

EEC- GA4 - view_item_list

Jul 5th, 2022 (edited)
71
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_item_list',              // name of the event. In this case, it always must be view_item_list
  4.   ecommerce: {                         
  5.     items: [{                           // an array where all currently viewed products must be included
  6.       item_name: 'Single Pattie Burger',            // insert an actual product name
  7.       item_id: 'SKU',               // insert an actual product ID
  8.       price: '530',                 // insert an actual product price. Number or a string. Don't include currency code
  9.       item_brand: 'Uno Burgers',            // insert an actual product price
  10.       item_category: 'Beef Burgers',            // insert an actual product top-level category
  11.       index: 1,                         // insert product's position in that list
  12.       quantity: '1'                     // product quantity. In case of view_item_list, it will usually be equal to 1
  13.     },{
  14.       item_name: 'Product 2',
  15.       item_id: 'product2',
  16.       price: '12.99',
  17.       item_brand: 'Brand B',
  18.       item_category: 'Category B',
  19.       item_variant: 'Yellow',
  20.       index: 2,
  21.       quantity: '1'
  22.     }]
  23.   }
  24. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement