Modificado en: Mar, 17 Ene, 2023 a 9:30 A. M.
Flujo de reserva
Usaremos los siguientes eventos de GA4:
Eventos | Key | GA4 event | Descripción |
Product Impression (Destino) | PID | view_item_list | Impresiones en resultados de búsqueda por destino |
Product Impression (Hotel) | PIH | view_item_list | Impresiones en resultados de búsqueda por hotel |
Product Click | CL | select_item | Click en product impression (hotel / habitacion) |
Product Detail | PD | view_item | Impresiones en resultado de búsqueda por hotel |
Add to Cart | AC | add_to_cart | Selección de habitación y añadir a carrito |
Checkout | CO | begin_checkout | Paso a formulario |
Purchase | PU | purchase | Compra |
| | | |
Variables
Configuramos las variables de eventos GA4 de tal forma:
Variable | Descripción | Ejemplo | PID | PIH | PD | AC | CO | PU |
item_id | ID hotel | 12345 | x | x | x | x | x | x |
item_name | Hotel | Hotel Demo Hotetec | x | x | x | x | x | x |
affiliation | Página de origen | HPH | x | x | x | x | x | x |
coupon | Código de descuento | BlackFriday2020 | x | x | x | x | x | x |
currency | Currency | EUR | x | x | x | x | x | x |
discount | Descuento aplicado | 2.22 | x | x | x | x | x | x |
index | Posición en búsqueda | 0 | x | x | x | x | x | x |
item_brand | Tipología (Hotel, Apartments) | Hotel | x | x | x | x | x | x |
item_category | Country hotel | ES | x | x | x | x | x | x |
item_category2 | Destino hotel | Mallorca | x | x | x | x | x | x |
item_category3 | Zona hotel | Can Pastilla | x | x | x | x | x | x |
item_list_id | Tipo de búsqueda ID | dest_ok | x | x | x | x | x | x |
item_list_name | Tipo de búsqueda | Destination OK | x | x | x | x | x | x |
item_variant | Habitación/Paquete | Doble Estandard | | x | x | x | x | x |
price | Precio total habitación | 100 | x | x | x | x | x | x |
quantity | Número de habitaciones | 1 | x | x | x | x | x | x |
regimen | Regimen | TI, SO, AD | | x | x | x | x | x |
tarifa | Tarifa | Non Refundable | | x | x | x | x | x |
check_in | Check-in | 20-12-2022 | x | x | x | x | x | x |
check_out | Check-out | 25-12-2022 | x | x | x | x | x | x |
booking_window | Booking window | 65 | x | x | x | x | x | x |
noches | Noches reserva | 5 | x | x | x | x | x | x |
pax | PAX Adultos-Niños-Bebes | 2–0-0 | x | x | x | x | x | x |
Específicamente para los eventos de “impression” trabajaremos con cuatro variables de
item_list_name:
item_list_name | item_list_id | Value |
Hotel OK | hotel_ok | Search by hotel with availability |
Hotel KO | hotel_ko | Search by hotel without availability |
Destination OK | destination_ok | Search by destination with availability |
Destination KO | destination_ko | Search by destination without availability |
IMPORTANTE: “Hotel KO” y “Destiantion KO” no están implementados porque el motor no devuelve las búsquedas sin resultados pero siempre ofrece alternativas.
Implementación
1. Product impressions (destino) - view_item_list
https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtm#select_an_item_from_a_list
Descripción: Registramos cada búsqueda a nivel destino con evento de view_item_list (impression) que incluye un array con hoteles.
Página: Búsquedas por destino
Trigger: Lanzamos dataLayer push al devolver resultados de búsqueda.
Event Name: view_item_list
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object. dataLayer.push({ event: "view_item_list", ecommerce: { items: [ {//Primer hotel item_id: "12345", item_name: "Hotetec Demo Hotel", affiliation: "HPH", coupon: "BLACKFRIDAY", currency: "EUR", discount: 10.00, index: 0, item_brand: "Hotel", item_category: "ES", item_category2: "Mallorca", item_category3: "Can Pastila", item_list_id: "dest_ok", item_list_name: "Destination OK", price: 99.99, check_in: "2022-12-01", check_out: "2022-12-05" , booking_window: 65, noches: 5, pax: 2-0-0, quantity: 1 }, { //Todos los hoteles }] } }); |
2. Product impressions (hotel & paquetes) - view_item_list
https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtm#select_an_item_from_a_list
Descripción: Registramos cada visita a nivel de hotel con evento view_item
Página: Visita de la página de disponibilidad a nivel de hotel
Trigger: Lanzamos dataLayer push al cargar la página con las habitaciones del hotel
Event Name: view_item
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object. dataLayer.push({ event: "view_item_list", ecommerce: { items: [ {//Primera habitación o paquete item_id: "12345", item_name: "Hotetec Demo Hotel", affiliation: "HPH", coupon: "BLACKFRIDAY", currency: "EUR", discount: 10.00, index: 2, item_brand: "Hotel", item_category: "ES", item_category2: "Mallorca", item_category3: "Can Pastila", item_list_id: "hotel_ok", item_list_name: "Hotel OK", item_variant: "Doble Estandard", price: 99.99, check_in: "2022-12-01" , check_out: "2022-12-05" , regimen: "AI", tarifa: "No reembosable", booking_window: 65, noches: 5, pax: 2-0-0, quantity: 1 }, { //Todas las habitaciones }] } }); |
3. Click habitación - select_item
https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtm#select_an_item_from_a_list
Descripción: Registramos cada click en resultados mediante un click que incluye información sobre el objeto seleccionado.
Página: Resultados de búsqueda destino/hotel
Trigger: Lanzamos dataLayer push al click a hotel
Event Name: select_item
Ejemplo habitación:
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object. dataLayer.push({ event: "select_item", ecommerce: { items: [ {// La habitación que ha recibido el click item_id: "12345", item_name: "Hotetec Demo Hotel", affiliation: "HPH", coupon: "BLACKFRIDAY", currency: "EUR", discount: 10.00, index: 2, item_brand: "Hotel", item_category: "ES", item_category2: "Mallorca", item_category3: "Can Pastila", item_list_id: "hotel_ok", item_list_name: "Hotel OK", item_variant: "Doble Estandard", price: 99.99, check_in: "2022-12-01" , check_out: "2022-12-05" , regimen: "AI", tarifa: "No reembosable", booking_window: 65, noches: 5, pax: 2-0-0, quantity: 1 }] } }); |
4. Add/remove to cart
https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtm#add_or_remove_an_item_from_a_shopping_cart
Descripción: Registramos la selección de una habitación con un evento de add to cart - add_to_cart
Página: Búsquedas → Checkout
Trigger: Lanzamos dataLayer push al seleccionar habitación (buton BOOK). En caso de multi habitaciones se lanza el datalayaer push para cada habitación añadida.
Event Name: add_to_cart
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object. dataLayer.push({ event: "add_to_cart", ecommerce: { items: [ { item_id: "12345", item_name: "Hotetec Demo Hotel", affiliation: "HPH", coupon: "BLACKFRIDAY", currency: "EUR", discount: 10.00, index: 2, item_brand: "Hotel", item_category: "ES", item_category2: "Mallorca", item_category3: "Can Pastila", item_list_id: "hotel_ok", item_list_name: "Hotel OK", item_variant: "Doble Estandard", price: 99.99, check_in: "2022-12-01" , check_out: "2022-12-05" , regimen: "AI", tarifa: "No reembosable", booking_window: 65, noches: 5, pax: 2-0-0, quantity: 1 }] } }); |
5. Checkout
5.1 begin_checkout
https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtm#initiate_the_checkout_process
Descripción: Registramos el paso a formulario de cliente con un evento de checkout.
Página: Client form (al cargar la página)
Trigger: Al cargar la página de checkout
Event: begin_checkout
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object. dataLayer.push({ event: "begin_checkout", ecommerce: { currency: "EUR", value: 89.99, coupon: "BLACKFRIDAY", items: [ { item_id: "12345", item_name: "Hotetec Demo Hotel", affiliation: "HPH", coupon: "BLACKFRIDAY", currency: "EUR", discount: 10.00, index: 2, item_brand: "Hotel", item_category: "ES", item_category2: "Mallorca", item_category3: "Can Pastila", item_list_id: "hotel_ok", item_list_name: "Hotel OK", item_variant: "Doble Estandard", price: 99.99, check_in: "2022-12-01" , check_out: "2022-12-05" , regimen: "AI", tarifa: "No reembosable", booking_window: 65, noches: 5, pax: 2-0-0, quantity: 1 },{ //todas las habitaciones }] } }); |
5.2 add_shipping_info
https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtm#add_shipping_info-gtm
Trigger: Cuando se rellena el campo de los datos del cliente
Event: add_shipping_info
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object. dataLayer.push({ event: "add_shipping_info", ecommerce: { currency: "EUR", value: 89.99, coupon: "BLACKFRIDAY", items: [ { item_id: "12345", item_name: "Hotetec Demo Hotel", affiliation: "HPH", coupon: "BLACKFRIDAY", currency: "EUR", discount: 10.00, index: 2, item_brand: "Hotel", item_category: "ES", item_category2: "Mallorca", item_category3: "Can Pastila", item_list_id: "hotel_ok", item_list_name: "Hotel OK", item_variant: "Doble Estandard", price: 99.99, check_in: "2022-12-01" , check_out: "2022-12-05" , regimen: "AI", tarifa: "No reembosable", booking_window: 65, noches: 5, pax: 2-0-0, quantity: 1 }] } }); |
5.3 add_payment_info
https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtm#add_payment_info-gtm
Trigger: Cuando se rellena el campo de los datos de la tarjeta
Event: add_payment_info
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object. dataLayer.push({ event: "add_payment_info", ecommerce: { currency: "EUR", value: 89.99, coupon: "BLACKFRIDAY", payment_type: "Credit Card", items: [ { item_id: "12345", item_name: "Hotetec Demo Hotel", affiliation: "HPH", coupon: "BLACKFRIDAY", currency: "EUR", discount: 10.00, index: 2, item_brand: "Hotel", item_category: "ES", item_category2: "Mallorca", item_category3: "Can Pastila", item_list_id: "hotel_ok", item_list_name: "Hotel OK", item_variant: "Doble Estandard", price: 99.99, check_in: "2022-12-01" , check_out: "2022-12-05" , regimen: "AI", tarifa: "No reembosable", booking_window: 65, noches: 5, pax: 2-0-0, quantity: 1 }] } }); |
6. Purchase
https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtm#make_a_purchase_or_issue_a_refund
Trigger: Cuando se confirma la reserva
Event: purchase
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object. dataLayer.push({ event: "purchase", ecommerce: { transaction_id: "MAJ12345678", affiliation: "HPH", value: 89.99, tax: 4.90, currency: "EUR", coupon: "BLACKFRIDAY", items: [ { item_id: "12345", item_name: "Hotetec Demo Hotel", affiliation: "HPH", coupon: "BLACKFRIDAY", currency: "EUR", discount: 10.00, index: 2, item_brand: "Hotel", item_category: "ES", item_category2: "Mallorca", item_category3: "Can Pastila", item_list_id: "hotel_ok", item_list_name: "Hotel OK", item_variant: "Doble Estandard", price: 99.99, check_in: "2022-12-01" , check_out: "2022-12-05" , regimen: "AI", tarifa: "No reembosable", booking_window: 65, noches: 5, pax: 2-0-0, quantity: 1 }, { //Todas las habitaciones }] } }); |