Advertisement
Vojkovic

Add_shipping_Info

Dec 24th, 2023 (edited)
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. window.dataLayer = window.dataLayer || [];
  2. window.dataLayer.push({ ecommerce: null });  // Clear previous ecommerce data
  3. window.dataLayer.push({
  4.   event: "add_shipping_Info",
  5.   ecommerce: {
  6.     // EVENT LEVEL DATA OBJECT
  7.     event_details: {
  8.       event_id: "136851e7-3dca-46ac-b459-5ff8017d5820",  // Unique Event ID
  9.       content_group: "Product Detail",                   // Page Type
  10.       currency: "EUR",                                   // Currency Code
  11.       value: 14.50                                       // Event Value
  12.       coupon: 20%                                       // The coupon name/code associated with the item. Event-level and item-level coupon parameters are independent.
  13.       shipping_tier: Free Shipping // The shipping tier selected for delivery of the purchased item.
  14.  
  15.     },
  16.     // USER DATA OBJECT
  17.     user_details: {
  18.       user_email: '[email protected]'                     // User Email
  19.     }
  20.   },
  21.   // GA4 ITEMS ARRAY
  22.   items: [{
  23.     item_id: "123abc",                                   // item SKU
  24.     item_name: "Skin Tracking Kit",                      // Product Name
  25.     affiliation: "Online Store",                         // Site Segment
  26.     currency: "EUR",                                     // Product Currency Code
  27.     coupon: "SUMMER_SOLUTION",                           // Product Level Coupon/Promo
  28.     discount: 5.00,                                      // Product Level Discount for Sale items
  29.     index: 0,                                            // Product Position in List
  30.     item_brand: "Mesagona",                              // Product Brand
  31.     item_category: "",                                   // Shop by Category
  32.     item_category2: "",                                  // Product Category 2
  33.     item_category3: "",                                  // Product Category 3
  34.     item_category4: "",                                  // Product Category 4
  35.     item_category5: "",                                  // Product Category 5
  36.     item_variant: "",                                    // Product Variant
  37.     location_id: "Product Detail",                       // Current Page Type | Event Location
  38.     price: 14.50,                                        // Product Price | Actual Selling Price
  39.     quantity: 1                                          // Quantity Added to Cart
  40.   }]
  41. });
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement