By specifying “data-callback” when including the Sirvoy widget, you will be able to catch events and run your own custom scripts (see example below). In most scenarios, you will only be interested in the ‘booking_completed’ event.

The following events are currently available:

  • page_search – fires when displaying the search form.
    • Data: user_data (arrivalDate, departureDate, totalAdults, category)
  • page_results – fires when displaying the search results.
    • Data: user_data (same as page_search)
  • page_details – fires when displaying the guest details input form.
    • Data: user_data (same as page_search)
  • page_payment – fires depending on the payment solution being used, when the payment information is displayed.
    • Data: payment_data (payment_processor), booking (JSON object of booking – may be provisional or final, depending on whether payment is required or optional)
  • booking_completed – fires when booking is final and completed, this usually happens in combination with the ‘page_thanks’ event. However, if payment is set as optional, it might fire in combination with the ‘page_payment’ event.
    • Data: booking (JSON object of completed booking)
  • page_thanks – fires when displaying the confirmation page.
    • Data: booking (JSON object of completed booking)

Below is an example that can be used to explore the different available events and associated data. Make sure to replace “data-form-id” with your own booking engine ID.

For information on adding a script in order to use a custom gallery for the booking engine of your website, please see this article.

Tip: If no payment solution or prepayment is activated, the booking_completed event will fire normally. However, if you activate a payment provider and set payments to be required, the page displaying the link to the payment provider will only trigger the event “page_payment”.

And only if the guest clicks the link at the end of the payment process, which takes him back to the confirmation page for the hotel, the “page_thanks” and “booking_completed” events will be triggered. In most cases, the guest will consider it done when the payment is completed (depending on the payment provider’s procedure.