Advertisement
jaspacio

GA4 Select Item

Mar 21st, 2023
714
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. dataLayer.push({ ecommerce: null });  // Clear the previous ecommerce object.
  2. dataLayer.push({
  3.   event: "select_item",                 // This event is sent once a user selects an item from the list
  4.   ecommerce: {
  5.     item_list_id: "related_products",
  6.     item_list_name: "Related products",
  7.     items: [
  8.     {
  9.       item_id: "SKU_12345",
  10.       item_name: "Stan and Friends Tee",
  11.       affiliation: "Google Merchandise Store",
  12.       coupon: "SUMMER_FUN",
  13.       discount: 2.22,
  14.       index: 0,
  15.       item_brand: "Google",
  16.       item_category: "Apparel",
  17.       item_category2: "Adult",
  18.       item_category3: "Shirts",
  19.       item_category4: "Crew",
  20.       item_category5: "Short sleeve",
  21.       item_list_id: "related_products",
  22.       item_list_name: "Related Products",
  23.       item_variant: "green",
  24.       location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",
  25.       price: 9.99,
  26.       quantity: 1
  27.     }
  28.     ]
  29.   }
  30. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement