Skip to content

Event Schemas

This section catalogs every user event exposed on analytics.track by @reservamos/browser-analytics@1.1.3, with props taken from the package Zod schemas.

Typed track methods use the form analytics.track.<method>(props, meta?), where meta is optional EventMetadata (a record of primitives or arrays of primitives). customEvent takes a caller-supplied event name first.

Conventions

  • Mixpanel event names use Title Case with spaces (e.g. Interest In Home).
  • Track methods use camelCase (e.g. interestInHome).
  • Property keys are usually Title Case with spaces (e.g. Departure Delta). The exception is lowercase product.
  • Dates are strings validated as at least YYYY-MM-DD (some fields also accept datetime).
  • product (when present) must be one of: web, web-mobile, ios, android, app.

Event index

Mixpanel event nameMethodProps type
Interest In HomeinterestInHomeInterestInHomeProps
Interest In SearchinterestInSearchInterestInSearchProps
SearchsearchSearchProps
View ResultsviewResultsViewResultsProps
Seat ChangeseatChangeSeatChangeProps
Passengers CreatedpassengersCreatedPassengersCreatedProps
Payment AttemptpaymentAttemptPaymentAttemptProps
Purchase AttemptpurchaseAttemptPurchaseAttemptProps
Picked DeparturepickedDeparturePickedDepartureProps
Purchase CanceledpurchaseCanceledPurchaseCanceledProps
Geolocation SelectedgeolocationSelectedGeolocationSelectedProps
(caller-supplied name)customEventCustomEventProps

Interest In Home

Triggered when the user accesses the home page.

  • Method: analytics.track.interestInHome(props, meta?)
  • Props type: InterestInHomeProps
ParameterTypeRequiredDescription
productenumProduct channel: web, web-mobile, ios, android, app

Triggered when the user interacts with the search functionality.

  • Method: analytics.track.interestInSearch(props, meta?)
  • Props type: InterestInSearchProps
ParameterTypeRequiredDescription
productenumProduct channel: web, web-mobile, ios, android, app
OriginstringOrigin city name
DestinationstringDestination city name
Departurestring (date)Departure date
Returnstring (date)Return date
Departure DatestringDeparture date as free-form string

Triggered when the user performs a search.

  • Method: analytics.track.search(props, meta?)
  • Props type: SearchProps
ParameterTypeRequiredDescription
Departurestring (date/datetime)Departure date of the search
Departure DeltaintegerDays between now and the searched trip
DestinationstringDestination city name
Destination TerminalstringDestination terminal or airport
OriginstringOrigin city name
Origin TerminalstringOrigin terminal or airport
PassengersintegerNumber of passengers in the search
RoutestringRoute by city name (e.g. Ciudad de México - Querétaro)
productenumProduct channel: web, web-mobile, ios, android, app
Returnstring (date/datetime)Return date
Trip Lengthnumber (positive)Trip duration; only meaningful when a return date is provided
Categoriesstring[]Search categories

View Results

Triggered when search results are displayed.

  • Method: analytics.track.viewResults(props, meta?)
  • Props type: ViewResultsProps
ParameterTypeRequiredDescription
Bus countintegerNumber of buses in the results (property casing is Bus count)
Departurestring (datetime)Departure datetime of the search
OriginstringOrigin city name
Origin TerminalstringOrigin terminal or airport
RoutestringRoute by city name
productenumProduct channel: web, web-mobile, ios, android, app
Departure DeltaintegerDays between now and the searched trip
DestinationstringDestination city name
Destination TerminalstringDestination terminal or airport
Has Frequent BusesbooleanWhether frequent buses are present (defaults to false)

Seat Change

Triggered when the user changes a seat selection.

  • Method: analytics.track.seatChange(props, meta?)
  • Props type: SeatChangeProps
ParameterTypeRequiredDescription
Arrivalstring (date/datetime)Arrival date or datetime
Departurestring (date/datetime)Departure date or datetime
DestinationstringDestination city name
Destination TerminalstringDestination terminal
OriginstringOrigin city name
Origin TerminalstringOrigin terminal
Pricenumber (positive)Seat / segment price
RoutestringRoute by city name
Ticketsinteger (positive)Number of tickets
TransporterstringTransporter name
Wayenum'Departure' or 'Return'
productenumProduct channel: web, web-mobile, ios, android, app
LinestringLine name
Stopsinteger (non-negative)Number of stops

Passengers Created

Triggered when passengers are created for a booking flow.

  • Method: analytics.track.passengersCreated(props, meta?)
  • Props type: PassengersCreatedProps
  • Schema is strict (unknown top-level keys are rejected).
ParameterTypeRequiredDescription
Tripstrip object[] (min 1)Trip objects; see Trip schema
Passenger CountintegerNumber of passengers
TotalnumberTotal amount
productenumProduct channel: web, web-mobile, ios, android, app
Trip CountintegerNumber of trips
Passengerspassenger object[] (min 1)Passenger objects; see Passenger schema

Payment Attempt

Triggered when the user attempts a payment.

  • Method: analytics.track.paymentAttempt(props, meta?)
  • Props type: PaymentAttemptProps
  • Schema is strict (unknown top-level keys are rejected).
ParameterTypeRequiredDescription
Tripstrip object[] (min 1)Trip objects; see Trip schema
Passenger CountintegerNumber of passengers
Trip CountintegerNumber of trips
Payment TypestringSelected payment type
TotalnumberTotal amount
productenumProduct channel: web, web-mobile, ios, android, app
Operation IdstringOperation identifier
Passengerspassenger object[] (min 1)Passenger objects; see Passenger schema
InsurancebooleanWhether insurance is included
CouponstringPromotional coupon
User StatusstringUser status

Purchase Attempt

Triggered when the user attempts a purchase.

  • Method: analytics.track.purchaseAttempt(props, meta?)
  • Props type: PurchaseAttemptProps
  • Schema is strict (unknown top-level keys are rejected).
ParameterTypeRequiredDescription
Tripstrip object[] (min 1)Trip objects; see Trip schema
Passenger CountintegerNumber of passengers
Trip CountintegerNumber of trips
TotalnumberTotal amount
productenumProduct channel: web, web-mobile, ios, android, app
Operation IdstringOperation identifier
Passengerspassenger object[] (min 1)Passenger objects; see Passenger schema

Picked Departure

Triggered when the user selects a departure result.

  • Method: analytics.track.pickedDeparture(props, meta?)
  • Props type: PickedDepartureProps
ParameterTypeRequiredDescription
Arrivalstring (datetime)Arrival datetime
Departurestring (datetime)Departure datetime
DestinationstringDestination city name
Destination TerminalstringDestination terminal
OriginstringOrigin city name
Origin TerminalstringOrigin terminal
Pricenumber (positive)Price
Result PositionintegerPosition of the result in the list
RoutestringRoute by city name
Stopsinteger (non-negative)Number of stops
Transport TypestringTransport type
TransporterstringTransporter name
productenumProduct channel: web, web-mobile, ios, android, app
Recommended TripbooleanWhether the trip is recommended
Trip TypestringTrip type
Bus TypestringBus type
LinestringLine name
Recommended Trip TypestringRecommended trip type

Purchase Canceled

Triggered when a purchase is canceled.

  • Method: analytics.track.purchaseCanceled(props, meta?)
  • Props type: PurchaseCanceledProps
ParameterTypeRequiredDescription
Operation IdstringOperation identifier
productenumProduct channel: web, web-mobile, ios, android, app
Tripstrip object[] (min 1)Trip objects; see Trip schema
Passenger CountnumberNumber of passengers
TotalnumberTotal amount
Trip CountnumberNumber of trips
Passengerspassenger object[] (min 1)Passenger objects; see Passenger schema

Geolocation Selected

Triggered when the user selects a geolocation.

  • Method: analytics.track.geolocationSelected(props, meta?)
  • Props type: GeolocationSelectedProps
ParameterTypeRequiredDescription
Selected CitystringSelected city name
Selected Country CodestringSelected country code

Custom Event

Tracks a caller-defined Mixpanel event name with a free-form data object.

  • Method: analytics.track.customEvent(eventName, eventData?, meta?)
  • Props type: CustomEventProps (for eventData)
ParameterTypeRequiredDescription
eventNamestring (min 1)Mixpanel event name (first argument, not part of CustomEventProps)
eventDataCustomEventPropsRecord whose values are primitives (string, boolean, number, undefined) or arrays of those primitives
metaEventMetadataOptional metadata record with the same value constraints

Shared schemas

Events that send Trips or Passengers use the shared trip and passenger object shapes below. Before send, the SDK flattens arrays of objects (flattenEventData): each inner property becomes a Mixpanel array property across items.

Trip schema

Used by Passengers Created, Payment Attempt, Purchase Attempt, and Purchase Canceled when Trips is present.

ParameterTypeRequiredDescription
Departure Arrivalstring (date)Departure arrival datetime
Departure DestinationstringDeparture destination city
Departure Destination TerminalstringDeparture destination terminal
Departure LinestringDeparture line
Departure OriginstringDeparture origin city
Departure Origin TerminalstringDeparture origin terminal
Departure PricenumberDeparture price
Departure RoutestringDeparture route
Departure StopsintegerDeparture stops
Departure Timestring (date)Departure time
Departure Transport TypestringDeparture transport type
Departure TransporterstringDeparture transporter
Recommended TripbooleanWhether the trip is recommended
Return Arrivalstring (date)Return arrival datetime
Return DestinationstringReturn destination city
Return Destination TerminalstringReturn destination terminal
Return LinestringReturn line
Return OriginstringReturn origin city
Return Origin TerminalstringReturn origin terminal
Return PricenumberReturn price
Return RoutestringReturn route
Return StopsintegerReturn stops
Return Timestring (date)Return time
Return Transport TypestringReturn transport type
Return TransporterstringReturn transporter
Recommended Trip TypestringRecommended trip type

Passenger schema

Used when a Passengers array is present. Schema is strict.

ParameterTypeRequiredDescription
Passenger Birthdatestring (date)Passenger birthdate
Passenger SeatstringPassenger seat
Passenger NamestringPassenger name
Passenger Document TypestringDocument type
Passenger Document IdstringDocument id