Advertisement
LouisDon

dataLayer_ga4_view_item

Jan 18th, 2022
1,063
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: "view_item",
  4.   ecommerce: {
  5.        items: [
  6.     {
  7.          item_id: "SKU_12345",
  8.          item_name: "Stan and Friends Tee",
  9.          affiliation: "Google Merchandise Store",
  10.          coupon: "SUMMER_FUN",
  11.          currency: "USD",
  12.          discount: 2.22,
  13.          index: 0,
  14.          item_brand: "Google",
  15.          item_category: "Apparel",
  16.          item_category2: "Adult",
  17.          item_category3: "Shirts",
  18.          item_category4: "Crew",
  19.          item_category5: "Short sleeve",
  20.          item_list_id: "related_products",
  21.          item_list_name: "Related Products",
  22.          item_variant: "green",
  23.          location_id: "L_12345",
  24.          price: 9.99,
  25.          quantity: 1
  26.     }
  27.     ]
  28.   }
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement