Documentation
Difficulty level:
Usecase - meet het aantal reserveringen
This article assumes knowledge of the articles in the GTM section.
The use case: we want to measure the number of reservations that have been paid for by means of a gift voucher. In this case, some logic is needed. The price of the reservation is now 0. . This allows us to add a small IF-THEN. The result
We enter this script in i-Reserve.
ireserve.on("createBooking", function(booking){
console.log('createBooking');
console.log('i-res bookingnumber', booking.booking_id);
console.log('price', booking.price);
if (booking.price == 0) {
console.log('price is 0 gift voucher payment');
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'bookingMade',
'details': {
'bookingnumber': booking.booking_id
}
});
}
});
In GTM we use a Custom Event "BookingGift".
We only set up one variable for this. dlv-bookingnumber.
In GA we mark this event as a key event.
Result: for every gift voucher payment made, there is a conversion in GA.





