Spec: Hotel Events

Event Lifecycle Overview

Browsing

ActionDescription
Products SearchedUser searched for products

Core Ordering

ActionDescription
Product ViewedUser viewed a product details
Checkout StartedUser initiated the order process (a transaction is created)
Payment Info EnteredUser added payment information
Order CompletedUser completed the order

Browsing

Products Searched

Fire this event when a visitor searches for products.

This event supports the following semantic properties:

PropertyTypeDescription
queryStringQuery the user search with
location.zipStringZip Code where the Hotel is located
location.cityStringCity where the Hotel is located
location.stateStringState where the Hotel is located
location.countryStringCountry where the Hotel is located
checkin_dateDateCheck in date
checkout_dateDateCheck out date
quantityNumberNumber of rooms
booking_windowNumberDays between todays date and checkin date
couponStringCoupon searched with

Example:

analytics.track('Products Searched', {
  query: 'Sedona AZ',
  location: {
    zip: '86336',
    city: 'Sedona',
    state: 'Arizona',
    country: 'USA'
  },
  checkin_date: 'Sat Jun 18 2016 12:00:00 GMT-0700',
  checkout_date: 'Thu Jun 24 2016 12:00:00 GMT-0700',
  quantity: 3,
  guests: 3,
  booking_window: 3 // days between checkin date - todays date
  nights: 10, // days between checkout - checkin
  coupon: 'MIT2013'
});

Core Ordering

Product Viewed

Fire this event when a visitor views a product. That view might happen on a page, screen, or preview modal.

This event supports the following semantic properties:

PropertyTypeDescription
queryStringQuery the user searched with
location.zipStringZip Code where the Hotel is located
location.cityStringCity where the Hotel is located
location.stateStringState where the Hotel is located
location.countryStringCountry where the Hotel is located
product_idStringRoom’s ID
nameStringName of the hotel
checkin_dateDateCheck in date
checkout_dateDateCheck out date
currencyStringCurrency of the transaction
priceNumberNumber of price for a single quantity of the room
quantityNumberNumber of rooms
guestsNumberNumber of guests
valueNumberTotal value from this product
booking_windowNumberDays between todays date and checkin date
nightsNumberInferred number of nights stayed

Example:

analytics.track('Product Viewed', {
  query: 'Sedona AZ',
  location: {
    zip: '86336',
    city: 'Sedona',
    state: 'Arizona',
    country: 'USA'
  },
  product_id: '507f1f77bcf86cd799439011',
  name: 'Hudson Hotel',
  checkin_date: 'Sat Jun 18 2016 12:00:00 GMT-0700',
  checkout_date: 'Thu Jun 24 2016 12:00:00 GMT-0700',
  currency: 'usd',
  price: 18.99,
  quantity: 1,
  guests: 3,
  value: 18.99,
  booking_window: 3 // days between checkin date - todays date
  number_of_nights: 10, // days between checkout - checkin
});

Note: The Product Viewed event is aliased to the Viewed Product event from e-commerce v1 spec.

Checkout Started

Fire this event whenever an order/transaction was started. Fire on the page that the customer lands on after they press the checkout button.

This event supports the following semantic properties:

PropertyTypeDescription
checkout_idStringCheckout ID
order_idStringOrder/transaction ID
order_dateDateDate the transaction occurred
queryStringWhat search query resulted in this booking
totalNumberRevenue with discounts and coupons added in. Note that our Google Analytics Ecommerce integration accepts total or revenue, but not both. For better flexibility and total control over tracking, we let you decide how to calculate how coupons and discounts are applied
revenueNumbertransaction coupon redeemed with the transaction
taxNumberTotal tax associated with the transaction
discountNumberTotal discount associated with the transaction
couponStringTransaction coupon redeemed with the transaction
currencyStringCurrency code associated with the transaction
roomsArrayrooms in the order
rooms.$.location.zipStringZip Code where the Hotel is located
rooms.$.location.cityStringCity where the Hotel is located
rooms.$.location.stateStringState where the Hotel is located
rooms.$.location.countryStringCountry where the Hotel is located
rooms.$.product_idStringDatabase id of the product being viewed
rooms.$.nameStringThe name of the Hotel
rooms.$.checkin_dateDateThe date of checkin
rooms.$.checkout_dateDateThe date of checkout
rooms.$.priceStringNumber of price for a single quantity of the room
rooms.$.quantityNumberThe number of rooms
rooms.$.guestsNumberThe number of guests
rooms.$.valueNumberTotal value from this product
rooms.$.booking_windowNumberDays between check in and todays date
rooms.$.number_of_nightsNumberDays between check in and check out

Example:

analytics.track('Checkout Started', {
  checkout_id: 'ch_29fj9fj39j3f93jf39fj',
  order_id: 'or_50314b8e9bcf000000000000',
  order_date: 'Sat Jun 15 2016 12:00:00 GMT-0700',
  query: 'Sedona AZ',
  total: 100,
  revenue: 80,
  tax: 20,
  discount: 10,
  coupon: 'cool-summer',
  currency: 'USD',
  rooms: [
    {
      location: {
        zip: '86336',
        city: 'Sedona',
        state: 'Arizona',
        country: 'USA'
      },
      product_id: '507f1f77bcf86cd799439011',
      name: 'Hudson Hotel',
      checkin_date: 'Sat Jun 18 2016 12:00:00 GMT-0700',
      checkout_date: 'Thu Jun 24 2016 12:00:00 GMT-0700',
      price: 90,
      quantity: 1,
      guests: 3,
      value: 90,
      booking_window: 3 // days between checkin date - todays date
      number_of_nights: 10 // days between checkout - checkin
    }
  ]
});

Note: The Checkout Started event is aliased to the Started Order event from Segment’s GA Enhanced E-Commerce Integrations.

Payment Info Entered

Fire this event whenever payment information has been successfully entered.

This event supports the following semantic properties:

PropertyTypeDescription
checkout_idStringCheckout transaction ID
order_idStringOrder ID (optional)

Example:

analytics.track('Payment Info Entered', {
  checkout_id: '39f39fj39f3jf93fj9fj39fj3f',
  order_id: 'dkfsjidfjsdifsdfksdjfkdsfjsdfkdsf'
});

Note: You can have as many or as few steps in the checkout funnel as you’d like. Note that you’ll still need to track the Order Completed event per our standard e-commerce tracking API after you’ve tracked the checkout steps.

Note: The Payment Info Entered event is aliased to the Completed Checkout Step event from Segment’s GA Enhanced E-Commerce Integration.

Order Completed

Fire this event whenever an order/transaction was successfully completed by the customer.

This event supports the following semantic properties:

PropertyTypeDescription
checkout_idStringCheckout ID
order_idStringOrder/transaction ID
order_dateDateDate the transaction occurred
payment_typeStringHow the rooms were payed for
queryStringWhat search query resulted in this booking
totalNumberRevenue with discounts and coupons added in. Note that our Google Analytics Ecommerce integration accepts total or revenue, but not both. For better flexibility and total control over tracking, we let you decide how to calculate how coupons and discounts are applied
revenueNumbertransaction coupon redeemed with the transaction
taxNumberTotal tax associated with the transaction
discountNumberTotal discount associated with the transaction
couponStringTransaction coupon redeemed with the transaction
currencyStringCurrency code associated with the transaction
roomsArrayrooms in the order
rooms.$.location.zipStringZip Code where the Hotel is located
rooms.$.location.cityStringCity where the Hotel is located
rooms.$.location.stateStringState where the Hotel is located
rooms.$.location.countryStringCountry where the Hotel is located
rooms.$.product_idStringDatabase id of the product being viewed
rooms.$.nameStringThe name of the Hotel
rooms.$.checkin_dateDateThe date of checkin
rooms.$.checkout_dateDateThe date of checkout
rooms.$.priceStringNumber of price for a single quantity of the room
rooms.$.quantityNumberThe number of rooms
rooms.$.guestsNumberThe number of guests
rooms.$.valueNumberTotal value from this product
rooms.$.booking_windowNumberDays between check in and todays date
rooms.$.number_of_nightsNumberDays between check in and check out

Example:

analytics.track('Order Completed', {
  checkout_id: 'fksdjfsdjfisjf9sdfjsd9f',
  order_id: '50314b8e9bcf000000000000',
  order_date: 'Sat Jun 15 2016 12:00:00 GMT-0700',
  payment_type: 'Visa',
  query: 'Sedona AZ',
  total: 100,
  revenue: 80,
  tax: 20,
  discount: 10,
  coupon: 'cool-summer',
  currency: 'USD',
  rooms: [
    {
      location: {
        zip: '86336',
        city: 'Sedona',
        state: 'Arizona',
        country: 'USA'
      },
      product_id: '507f1f77bcf86cd799439011',
      name: 'Hudson Hotel',
      checkin_date: 'Sat Jun 18 2016 12:00:00 GMT-0700',
      checkout_date: 'Thu Jun 24 2016 12:00:00 GMT-0700',
      price: 90,
      quantity: 1,
      guests: 3,
      value: 90,
      booking_window: 3 // days between checkin date - todays date
      number_of_nights: 10 // days between checkout - checkin
    }
  ]
});

Note: The Order Completed event is aliased to the Completed Order event from E-Commerce spec v1.


If you have any questions or see anywhere we can improve our documentation, please let us know or kick off a conversation in the Segment Community!