Google Triggers Reference
Last updated
Last updated
Notice of usage: Google Tag Manager (GTM) and Google Analytics 4 (GA4) are third party services and we provide this integration as is. We support a set of custom events and Data Layer variables for use with GTM and GA4, however we have no control over what happens to them and how they are used. The basic setup examples we provide have been tested and verified to work with the Mews Booking Engine, however if you need a more complex setup then we cannot provide the support to do so and we recommend to ask a specialist to set it up and test it for you.
This reference provides details of custom events and Data Layer variables generated within the Booking Engine, which can be used to trigger analytics tags to fire, i.e. to send data to Google Analytics. You will need to reference these events and variables when setting up tag triggers in Google Tag Manager.
All event data is passed to Google Tag Manager through a Data Layer.
What is a Data Layer?A Data Layer is a Javascript object in a website or app that collects analytics data in a standardized way. It acts as a layer between the site and the tag management system. The layer stores values, such as page name and URL, that are populated automatically when a visitor uses the site. The data is transferred into tag management variables and can be used to activate triggers in your tag configurations. Google Help — The data layer
To use data from the Data Layer in your tags, in the GTM configuration set up a Variable with a suitable name as a Data Layer Variable (DLV), like this:
The Custom events reference below describes which Data Layer Variables are relevant to which custom events.
Prices: Note all prices currently presented via the Data Layer are gross prices, i.e. including taxes and fees.
GA4 pageview events
GA4 eCommerce events
Each event is fired with a standard set of data:
eventName
Name of the event, in readable form without prefix, e.g. Voucher Added
.
trackingConsents
If a user selects a hotel or property in the Booking Engine, information about it is also added to the event. In Singlehotel mode, the property is always selected.
hotelName
Name of the hotel or property
hotelId
Unique identifier of the hotel or property
enterpriseName
Array with name of the enterprise (hotel / property) in each supported language
Pageload events with the 'ga4_' prefix also have the following attributes available in the Data Layer:
page_location
URL style location, to be used for tracking URL
page_title
Human readable name of page or screen
Some events expose additional DLVs. These are described separately for each event.
advertising
boolean
required
Advertising, e.g. used to help advertisers deliver more relevant advertising, or to limit how many times you see an advertisment.
functional
boolean
required
Functional, non-essential functionality, e.g. remembering user choices made in the past.
necessary
boolean
required
Necessary functionality.
performance
boolean
required
Performance, e.g. collecting information about how users use a website; data are anonymized.
Event which fires when the application is loaded for the user
A voucher has been added into the booking
voucherCode
Code of voucher added by user
The properties selection step was loaded for the user
The calendar step has been loaded for the user
Categories / room selection has been shown to the user
startDate
Start of stay date selected by user
endDate
End of stay date selected by user
available
Array of room categories which have been shown to user as available
unavailable
Array of room categories which have been shown to user as not available
Each of the items in arrays follows the google Item specification for ecommerce, for example:
Rates selection has been shown to the user
rates
Array of rates shown to user, together with their currency and gross price
Products selection has been shown to the user
products
Array of products shown to user
Promoted Services has been shown to the user
Summary step has been shown to the user
The final screen with form to fill in has been shown to the user
Mews created a booking within the PMS. Additional information is available in the purchase
event.
The confirmation screen has been shown to the user. This step is shown after returning from the payment gateway as the final step of the process.
Please follow the Google guide for tracking eCommerce in GA4. You need to set up events with all mandatory parameters so they are tracked correctly. We are pushing all available variables into the eCommerce tracking for more advanced setups as well.
Voucher has been added to the booking
promotion_id
Array of rates shown to user
List of available rooms shown to user for eCommerce purposes
items
Array of items (rooms / categories) shown to user
User added room and products to cart
items
Array of items (rooms / categories / products) added by user in reservation
Example:
User removed an item from the cart. See add_to_cart
for event parameters.
items
Array of items (rooms / categories / products) remover by user in reservation
User started the process of check-out. See add_to_cart
for event parameters.
items
Array of items (rooms / categories / products) added by user in reservation
User added payment information.
payment_type
Payment type, usually PaymentCard
currency
Currency in which the payment will be done
value
Amount of the reservation
items
Array of items (rooms / categories / products) added by user in reservation
Purchase made. This is the most important eCommerce event. We expose many variables in the event which can be used for advanced tracking. See the example for full description. The Purchase event is triggered on the booking confirmation screen under the following conditions:
Payment Success: When the user returns from the payment gateway, and the payment is successfully completed.
Flexible Rates: If the booking selected flexible rates and no payment is required, the Purchase event is triggered immediately upon booking confirmation.
The most important variables are:
startDate
Start of stay date selected by user
endDate
End of stay date selected by user
currency
Currency in which the payment will be done
value
Amount of the reservation
tax
Amount of tax for the reservation
reservationGroupName
ID / Name of the reservation group created in Mews
netValue
Value of reservation without taxes
grossValue
Value of reservation with all taxes
pricingMode
either gross
for US style of pricing, net
for EU style of pricing
roomCount
Count of rooms in reservation
adults
Count of Adults in reservations
children
Count of children in reservations
items
Array of items (rooms / categories / products) added by user in reservation. See example for different types of items
Example:
The following annotated screenshots provide a visual illustration of GA4 related events and their respective trigger points within the Booking Engine.
applied at the time the event was created.