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 payments. We also take the status into account for this. Later, a distinction can also be made in GA between failure and success.
We enter this script in i-Reserve.
ireserve.on("paymentResult", function(status, message, json){
console.log('paymentResult');
const booking = JSON.parse(json);
console.log('booking.booking_id', booking.booking_id);
console.log(json);
console.log(booking);
var resnum = booking.booking_id;
console.log('i-res bookingnumber', booking.booking_id);
console.log('game', booking.object_desc);
console.log('phone ', booking.customer_tel_mob);
console.log('email ', booking.customer_email);
console.log('price', booking.price);
console.log('payment-status', status);
console.log('location', booking.object_short_desc);
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'bookingPaid',
'details': {
'i-res bookingnumber': booking.booking_id,
'game': booking.object_desc,
'price': booking.price,
'payment status': status,
'location': booking.object_short_desc,
'phone': booking.customer_tel_mob,
'email': booking.customer_email
}
});
});
In GTM we use a Custom Event "BookingPaid".
We only set up one variable for this. dlv-bookingnumber.
In GA we mark this event as a key event.
Result: for every reservation made there is a conversion into GA.





