The addHotelBooking
method passes information from your site to Monetate when a customer completes the purchase of a hotel. This method consists of 10 mandatory attributes and five optional attributes.
Required Attributes
These attributes are required with the addHotelBooking
method:
checkIn
— A string that includes the check-in date for the hotel stay in YYYYMMDD formatcheckOut
— A string that includes the check-out date for the hotel stay in YYYYMMDD formatcity
— A string that includes the city where a hotel was searched forcountry
— A string that includes the country where a hotel was searched forguests
— An integer that includes the total number of adults and children staying in a hotel roomrooms
— An integer that includes the total number of hotel rooms searched forpurchaseId
— A string that includes the order ID for a purchased hotelpid
— A string without spaces that includes an internal ID used to identify a hotelquantity
— An integer that includes the number of hotel rooms bookedunitPrice
— A string that includes the price of the hotel in the format XX.XX
Optional Attributes
These attributes are optional for the addHotelBooking
method:
adults
— An integer that includes the total number of adults staying in a hotel roomchildren
— An integer that includes the total number of children staying in a hotel roomregion
— A string that includes the state, province, or region where a hotel was searched fortype
— A string that includes the type of hotel room searched forcurrency
— A string in the ISO 4217 format (three capital letters and no spaces) that includes the currency used to book the hotel
Code Sample
// addHotelBooking Method window.monetateQ = window.monetateQ || []; var bookingObject = { // Required 'checkIn': ['20160212'], // February 12, 2016 'checkOut': ['20160224'], // February 24, 2016 'city': ['London'], 'country': ['United Kingdom'], 'guests': [4], 'rooms': [1], // Optional 'adults': [2], 'children': [2], 'region': ['London'], 'type': ['Double'] }; window.monetateQ.push(['addHotelBooking', bookingObject, 'LON12345', 'Regents', 1, '400.00', // optional 'USD' ]); window.monetateQ.push(['trackData']);