Advertisement
Vojkovic

View item list

Mar 5th, 2025
174
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_list",
  4.   ecommerce: {
  5.     // EVENT LEVEL DATA OBJECT
  6.     event_details: {
  7.       event_location: "Product Listing",         // Same Value as location_id
  8.       timestamp: 1681398559488,                  // Event Timestamp Milliseconds
  9.       event_id: "1681398559488-488930455"        // milliseconds-nanoseconds
  10.       distributor_id: "603054",                  // Distributor ID
  11.     },
  12.     // USER DATA OBJECT
  13.     user_details: {
  14.       log_state: "Logged In",                    // User Account Status | Logged In or Logged Out
  15.       user_id: 6718882414758,                    // User Account ID
  16.       user_type: "Student",                      // User Type
  17.       // FACEBOOK CAPI (256 Hashed Data)
  18.       user_hashed_data: { },
  19.       // GOOGLE ADS ENHANCED CONVERSION
  20.       enhanced_conversion_data: { }
  21.     },
  22.     // GA4 ITEMS ARRAY
  23.     items: [{
  24.       item_id: "MT2779G",                             // Product Sku
  25.       item_name: "1/2" Drive Air Impact Wrench - Green", // Product Name
  26.      affiliation: "Digital Store",                   // Site Segment
  27.      currency: "USD",                                // Product Currency Code
  28.      coupon: "SUMMER_FUN",                           // Product Level Coupon/Promo
  29.      discount: 5.00,                                 // Product Level Discount for Sale items
  30.      index: 7,                                       // Product Position in List
  31.      item_brand: "Matco Tools",                      // Product Brand
  32.      item_category: "Power Tools",                   // Product Category 1
  33.      item_category2: "Air Tools",                    // Product Category 2
  34.      item_category3: "Impact Wrenches",              // Product Category 3
  35.      item_category4: "1/2" Impact Wrenches",         // Product Category 4
  36.       item_category5: undefined,                      // Product Category 5
  37.       item_variant: "Green"                           // Product Color (item_category4)
  38.       creative_name: undefined,                       // Original View / Click Product List Carousel Title - item_carousel_title
  39.       item_list_id: "Product Listing",                // Original View / Click Page Type
  40.       item_list_name: "Site Browse",                  // Site Browse, Product Carousel, Wishlist, or Search Results
  41.       location_id: "Product Detail",                  // Current Page Type | Event Location
  42.       price: 599.40,                                  // Product Price | Actual Selling Price
  43.       quantity: 2,                                    // Quantity set to 1 or undefined
  44.     }]
  45.   }
  46. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement