Google Tag Manager & GA4

The ReservHotel booking engine can load your own Google Tag Manager container or Google Analytics 4 tag on every booking step. This page explains how to add them and what each one receives.

Adding your code

  • Log into Studio
  • In the menu, go to Information → Booking Engine → Booking Engine General Settings.
  • Enter your code in one of the two Google Account fields and click save.

Each field takes one code: a Google Tag Manager container ID (GTM-XXXXXXX) or a GA4 measurement ID (G-XXXXXXXXXX). Use the second field to add another code, for example a GTM container and a separate GA4 property.

Code enteredWhat the booking engine loads
GTM-XXXXXXX Your Google Tag Manager container. See Google Tag Manager.
G-XXXXXXXXXX The GA4 tag (gtag.js) for your property. See GA4 measurement ID.

Notes

  • Tags load on every booking engine step: calendar, rooms, extras, checkout, confirmation and itinerary changes.
  • Tags do not load for bookings made by the ReservHotel call center.
  • For cross-domain tracking between your website and the booking engine, add reservhotel.com to the cross-domain settings of your GA4 property or GTM Google tag.

Google Tag Manager (GTM-)

The booking engine adds the standard GTM snippet for your container to the <head> of each page, and the <noscript> iframe to the <body>. Your container shares the page's window.dataLayer.

<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});
var f=d.getElementsByTagName(s)[0], j=d.createElement(s), dl=l!='dataLayer'?'&l='+l:'';
j.async=true; j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;
f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXXX');
</script>

Nothing is sent to GA4 or any other platform until you publish tags in your container. Use GTM's Preview mode to check your tags fire on the booking engine pages.

GA4 measurement ID (G-)

The booking engine loads gtag.js for your measurement ID and sends the following to your property. No setup is needed in GA4.

Page views

Every step sends a page view with two extra parameters, page_name and hotel_id. Incoming cross-domain links are accepted, so sessions that start on your website are kept.

gtag('config', 'G-XXXXXXXXXX', { 'page_name': 'rooms page', 'hotel_id': '555' });
gtag('set', 'linker', { 'accept_incoming': true, 'send_to': 'G-XXXXXXXXXX' });
page_nameStep
calendar pageCalendar / date selection
rooms pageRooms and rates
extras pageExtras / flights
finalize pageCheckout
confirmation pageConfirmation / itinerary
modification pageChange itinerary

To report on page_name and hotel_id, register them as event-scoped custom dimensions in GA4 (Admin → Custom definitions).

purchase

Sent once on the confirmation page, right after a new reservation is created. It does not fire again if the guest reloads the page later or opens the itinerary from the confirmation email. It uses the standard GA4 purchase event, so it appears in the GA4 ecommerce reports.

FieldDescription
transaction_idReservHotel confirmation number.
affiliationReservHotel hotel code.
valueRoom total + taxes and fees + extras. Flights are not included.
currencyHotel currency code.
items One HOTEL item: price per night × nights, with item_category set to the booking source.
One AMENITIES item when extras were added (insurance excluded).
One INSURANCE item when travel insurance was added.
gtag("event", "purchase", {
  send_to: "G-XXXXXXXXXX",
  transaction_id: "01234567",
  affiliation: "555",
  value: 1737.30,
  tax: 0,
  shipping: 0,
  currency: "USD",
  items: [
    { item_id: "01234567", item_name: "HOTEL - 555", item_variant: "Deluxe Ocean View - Best Available Rate",
      item_category: "Booking Engine", affiliation: "555", currency: "USD", index: 0, price: 289.00, quantity: 5 },
    { item_id: "01234567 - AMENITIES", item_name: "AMENITIES - 555", item_category: "AMENITIES",
      affiliation: "555", currency: "USD", index: 0, price: 90.00, quantity: 1 }
  ]
});