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.