Smarthotel Booking Engine – GTM Data Layer Specification
This guide outlines the Google Tag Manager (GTM) eCommerce events automatically pushed to the dataLayer
by SmartHOTEL’s Internet Booking Engine (IBE). These events allow you to track booking behavior and conversions for marketing and analytics platforms such as Google Analytics 4 (GA4).
📥 Event: add_to_cart
/ remove_from_cart
Description:
Triggered when a user adds or removes a room or package to/from their booking selection.
Event Names
-
add_to_cart
-
remove_from_cart
📄 Data Structure
🔹 Top-Level Fields
Field |
Type |
Description |
event |
string |
Either "add_to_cart" or "remove_from_cart" . |
ecommerce |
object |
Contains booking-related data. |
🔹 ecommerce
Object
Field |
Type |
Description |
currency |
string |
ISO 4217 currency code (e.g., "EUR" , "USD" ). |
value |
number |
Total value of selected items. |
arrival_date |
string |
Check-in date (YYYY-MM-DD ). |
departure_date |
string |
Check-out date (YYYY-MM-DD ). |
nights |
number |
Number of nights. |
guests |
number |
Number of guests. |
property_id |
string |
Unique property identifier. |
property_name |
string |
Human-readable name of the property. |
items |
array |
List of selected rooms/packages. |
🔹 items[]
Object
Field |
Type |
Description |
item_id |
string |
Identifier for the room/package. |
item_name |
string |
Name of the room/package. |
item_category |
string |
Rate name or package description. |
price |
number |
Price per item. |
quantity |
number |
Typically 1 per booking. |
rate_id |
string |
Internal rate code. |
🧾 Example Payload
{
"event": "add_to_cart",
"ecommerce": {
"currency": "USD",
"value": 568,
"arrival_date": "2025-05-02",
"departure_date": "2025-05-04",
"nights": 2,
"guests": 2,
"property_id": "761cced2-1371-4abd-9b24-4221e0cc98f1",
"property_name": "SmartHOTEL IBE New Technology",
"items": [
{
"item_id": "SPA",
"item_name": "Spa Room",
"item_category": "Two nights 1 dinner",
"price": 568,
"quantity": 1,
"rate_id": "2N1D"
}
]
}
}
✅ Event: purchase
Description:
Fires when a guest completes a booking and payment is confirmed.
Event Name
📄 Data Structure
🔹 Top-Level Fields
Field |
Type |
Description |
event |
string |
"purchase" |
ecommerce |
object |
Finalized booking information. |
🔹 ecommerce
Object
Field |
Type |
Description |
currency |
string |
ISO 4217 currency code. |
value |
number |
Total value of the booking. |
arrival_date |
string |
Check-in date (YYYY-MM-DD ). |
departure_date |
string |
Check-out date (YYYY-MM-DD ). |
nights |
number |
Total nights booked. |
guests |
number |
Number of guests. |
property_id |
string |
Unique property identifier. |
property_name |
string |
Display name of the property. |
reservation_id |
string |
Unique booking/reservation ID. |
payment_method |
string |
Payment type used (e.g., "Cards" ). |
items |
array |
List of rooms/packages booked. |
🔹 items[]
Object
Field |
Type |
Description |
item_id |
string |
Room/package ID. |
item_name |
string |
Room/package name. |
item_category |
string |
Rate/package description. |
price |
number |
Price per item. |
quantity |
number |
Quantity of each item. |
rate_id |
string |
Internal rate identifier. |
item_category2 |
string |
Optional: secondary classification (e.g., "Reservation" ). |
🧾 Example Payload
{
"event": "purchase",
"ecommerce": {
"currency": "USD",
"value": 926,
"arrival_date": "2025-05-02",
"departure_date": "2025-05-04",
"nights": 2,
"guests": 4,
"property_id": "761cced2-1371-4abd-9b24-4221e0cc98f1",
"property_name": "SmartHOTEL IBE New Technology",
"reservation_id": "109669792",
"payment_method": "Cards",
"items": [
{
"item_id": "CTW",
"item_name": "City Twin Room",
"item_category": "IBE RO rate",
"price": 358,
"quantity": 1,
"rate_id": "IBOBEX",
"item_category2": "Reservation"
},
{
"item_id": "SPA",
"item_name": "Spa Room",
"item_category": "Two nights 1 dinner",
"price": 568,
"quantity": 1,
"rate_id": "2N1D",
"item_category2": "Reservation"
}
]
}
}