SandroBabic

GA4 EC - Rudan Hotels - purchase

Mar 24th, 2026 (edited)
83
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: 'purchase',            // name of the event. In this case, it always must be purchase
  4.   ecommerce: {
  5.     currency: 'EUR',
  6.     value: 250.00,                      // total price of the reservation
  7.     transaction_id: 'abc123',           // reservation id
  8.     items: [{                           // an array with all products (that were in a cart when the checkout began)
  9.       item_name: 'Hotel Terme Jezerčica',           // insert an actual accommodation name
  10.       item_id: 'accommodation1',             // insert an actual accommodation ID
  11.       price: '250.00',                  // insert an actual accommodation price. Number or a string. Don't include currency code
  12.       item_category: 'Hotels',          // insert an actual accommodation top-level category
  13.       item_variant: 'Standard twin room, balcony', // insert room type or similar
  14.       accommodation_location: 'Donja Stubica',        // insert a accommodation location
  15.       check_in_date: '15.05.2026.',     // check in date
  16.       check_out_date: '16.05.2026.',        // check out date
  17.       number_of_nights: '1'
  18.       number_of_adults: '4',        // number of adults
  19.       number_of_children: '3',      // number of children
  20.       quantity: '1'                     // product quantity of accommodations, usually always 1
  21.     }]
  22.   }
  23. });
Advertisement
Add Comment
Please, Sign In to add comment