Technical Specification: Google Analytics 4 (GA4) Integration
- System: CASABLANCA Booking Engine and GA4
- Version: 2.0 (Consent Mode V2 Compliant)
- Date: 2026
1. Overview
Our Booking Engine offers a native, "plug-and-play" integration with Google Analytics 4. We handle the technical implementation of the DataLayer, Event Firing, and GDPR Consent Management automatically.
How to activate:
- Navigate to the CASABLANCA cloud > Booking Engine > Spaces > Space Settings.
- Enter the GA4 Measurement ID (Format:
G-XXXXXXXXXX). - Result: The system automatically injects the tracking code and enables the GDPR Cookie Banner on the frontend.
2. Privacy & Consent (GDPR/DSGVO)
We operate in Strict Mode (Austria/EU Standard) by default.
- Consent Mode V2: Fully implemented.
- Activation: The GA4 script and cookies are blocked until the user explicitly clicks "Accept" on the Cookie Banner.
- Signal Activation: Upon acceptance, we fire
gtag('consent', 'default', { ...granted... })and load the library.
3. E-Commerce Event Specification
We utilize the Standard GA4 E-commerce Schema. Data will automatically populate in "Monetization > E-commerce Purchases".
A. Funnel Events
We track the user journey from viewing a room to final purchase.
| Event Name | Trigger | Key Parameters Sent |
|---|---|---|
view_item_list | User views a list of offers / items. | item_list_id, item_list_name, items[] |
add_to_cart | User selects an offer or adds an item. | item_category, items[], value, currency |
remove_from_cart | User removes an offer or an item. | item_category, items[], value, currency |
begin_checkout | User enters the checkout page. | items[] (All shopping cart contents), value (Shopping cart total), currency |
add_shipping_info | User successfully submit checkout form. | items[], value, currency |
add_payment_info | Payment window is opened. (only if direct payment is required) | items[], value, currency |
purchase | User completes booking. | transaction_id, items[], value, currency |
B. Item Data Structure
The object structure of the items are as follows:
Stay
{
"item_id": "pms_123_pms_abc", // {roomTypeId}_{rateId}
"item_name": "Double room (Half board)", // {roomTypeName} ({rateName})
"item_category": "Stay",
"item_category2": "pms_123", // {roomTypeId}
"item_category3": "pms_abc", // {rateId}
"price": 150.00, // price per night
"quantity": 3, // number of nights
// custom dimensions
"arrival_date": "2026-02-01",
"departure_date": "2026-02-08",
"number_of_adults": 2,
"number_of_children": 0
}
AddOn
{
"item_id": "9a762d48-3be1-4eb3-b9ad-e8486824ad9c", // {upsellingArticleId}
"item_name": "Rückenmassage", // {upsellingArticleName)
"item_category": "AddOn",
"price": 50.00, // price per unit
"quantity": 1, // number of units
}
TravelInsurance
{
"item_id": "HOSPL", // {travelInsuranceCode}
"item_name": "Hotelstorno Plus", // {travelInsuranceName)
"item_category": "TravelInsurance",
"price": 50.00, // total premium
"quantity": 1, // always 1
}
4. Custom Dimensions (Optional)
We enrich the item of type Stay with additional booking context. To see these in your GA4 reports, you must register them as Custom Dimensions in your GA4 Property settings.
| Parameter Name | Scope | Description |
|---|---|---|
arrival_date | Item | The arrival date (ISO 8601). |
departure_date | Item | The departure date (ISO 8601). |
number_of_adults | Item | The number of adults in the room. |
number_of_children | Item | The number of children in the room. |
5. FAQ for Agencies
Q: Do we need to set up Google Tag Manager (GTM)?
A: No. We inject the gtag.js direct implementation.
Q: Are there any other tracking options besides GA4?
A: No. Since our focus is on providing an EU-compliant tracking interface, other tracking options are not provided.
Q: Can I customize the Cookie Banner?
A: The text of the Cookie Banner can't be edited, only the links. (CASABLANCA cloud > Booking Engine > Spaces > Space Settings > Links)
Q: Why do the rate / room type / add-on names differ from what is shown on the Booking Engine?
A: We send the internal name of these items. This makes sure that, regardless of the users language, the items are grouped correctly and allows for an easier correlation between the analytics data and the CASABLANCA system.
Q: What item categories are there?
A: We categorize the items as follows: Stay, AddOn (Upselling Articles), TravelInsurance
Q: What item lists are there?
A: We send events for the following lists: day_rates, package_teaser, package_detail, travel_insurance_offers, add_ons
Q: What about Cross-Domain Tracking?
A: GA4 handles this automatically if both domains use the same measurement ID and cross-domain tracking is enabled for that data stream.
Q: Why should I pass the UTM query params to the Booking Engine even if Cross-Domain Tracking is active?
A: If you pass the UTM query params utm_source, utm_medium and utm_campaign, we can enrich the reservation in the CASABLANCA system with this data.
Q: Why do I see "Unassigned" traffic?
A: Ensure your "Referral Exclusion List" in GA4 includes the payment gateway domains so the session doesn't break upon payment return.
Q: Is there a way to activate debug mode?
A: Yes. Add the local storage key ga4DebugMode with value enabled and reload the page. If successful you should see the message [Analytics] Initializing GA4 in debug mode ... in the dev console.