Skip to main content

[Booking Engine] Integration with Google Analytics 4

J
Written by Joelly See Toh

Here we will explain the steps to link with Google Analytics 4 to analyze access to AirHost Booking Engine.

*For information on how to create and operate a Google Analytics account, we do not provide support, so please refer to the following pages.

Please obtain the measurement ID in Google Analytics 4.

Put that measurement ID obtained into the Google Analytics Id of AirHost's booking engine.

The tracking code will now be embedded on each page and data collection will begin on the Google Analytics 4 side.

--- March 13, 2025 Update ---

The hotel ID (hotel parameter) has been added to the reservation confirmation page URL.


By retrieving this parameter in GA4, it is now possible to track conversions for each facility. (Additional setup is required.)

[How to set it up]

  • Using GA4’s "Custom Dimensions" to extract the hotel parameter from the page URL (without GTM)

  • Using Google Tag Manager (GTM) to send the hotel=△△△△ parameter via the data layer (recommended for managing multiple tags or integrating with ad tracking)

Examples:

  • If setting up with GA4’s built-in features only:

    • Navigate to "Engagement" → "Pages and Screens" and extract the hotel parameter using a custom dimension

  • For more advanced tracking and ad tag management:

    • Use GTM to capture the hotel ID as a variable and send it to GA4

💡 Using GTM allows for more precise tracking of reservation numbers per facility and enables better integration with ad conversion tracking.


Booking Completion Events in GA4

Currently, the only event automatically sent from AirHost Booking Engine to GA4 is page_view.

The purchase event is not automatically sent by AirHost when a booking is completed.

To track booking completions in GA4, you need to use Google Tag Manager (GTM) to configure a purchase event that is triggered when a user visits the booking completion page.

Tracking Booking Completion Events Using GTM

When a booking is successfully completed, the user is redirected to the Booking Engine's booking completion page.

The URL of this page contains the following parameters:

  • uid: The reservation ID

  • hotel: The property ID

You can use these URL parameters to send a purchase event from GTM to GA4.

1. Create a Trigger in GTM

Select Page View as the trigger type and choose Some Page Views.

Set the following two conditions:

  • Page Path → contains → /orders/

  • Page URL → contains → uid=R

2. Create Variables to Retrieve URL Parameters

In GTM, create the following two user-defined variables.

For retrieving the reservation ID

  • Variable Type: URL

  • Component Type: Query

  • Query Key: uid

For retrieving the property ID

  • Variable Type: URL

  • Component Type: Query

  • Query Key: hotel

3. Create a GA4 Event Tag

Select Google Analytics: GA4 Event as the tag type and configure the following settings:

  • Measurement ID: The GA4 Measurement ID configured in Booking Engine

  • Event Name: purchase

Set the following event parameters:

Parameter Name

Value

transaction_id

Reservation ID variable (uid)

hotel

Property ID variable (hotel)

Assign the trigger created in Step 1 to this tag.

4. Configure the Event in GA4

In GA4, configure the following settings:

  • Register hotel as an event-scoped custom dimension.

  • Mark purchase as a key event.

Important Notes on Tracking

By setting the reservation ID (uid) as the transaction_id, GA4 deduplicates multiple purchase events that have the same transaction_id for the same reservation.

This configuration allows you to retrieve the reservation ID and property ID. However, information such as booking amount, currency, and room type is not sent to GA4.

Therefore, GA4 ecommerce reports cannot show booking revenue or purchase information by property or room type.

For details such as the number of bookings and booking amounts, please refer to the reservation list or reports in AirHost PMS.


Tracking Bookings from Google Hotels

Currently, GA4 cannot identify traffic or bookings originating from Google Hotels.

  • UTM parameters are not added to the URL when users navigate from Google Hotels to the AirHost Booking Engine. Users cannot add these parameters themselves.

  • Bookings originating from Google Hotels are recorded in AirHost as bookings from the Booking Engine.

  • The Google Analytics ID setting in the Booking Engine sends page views to the user's own GA4 property. It does not identify traffic originating from Google Hotels or send booking amounts to GA4.

  • Booking amounts and revenue can be checked in AirHost order data.

Did this answer your question?