Skip to content

Event Schemas

This section catalogs every user event exposed on analytics.track by @reservamos/browser-analytics@1.1.6, 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
Purchase Confirmation ViewedpurchaseConfirmationPurchaseConfirmationProps
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
productenum✓Product 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
productenum✓Product 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 Deltainteger✓Days between now and the searched trip
Destinationstring✓Destination city name
Destination Terminalstring✓Destination terminal or airport
Originstring✓Origin city name
Origin Terminalstring✓Origin terminal or airport
Passengersinteger✓Number of passengers in the search
Routestring✓Route by city name (e.g. Ciudad de México - Querétaro)
productenum✓Product 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 countinteger✓Number of buses in the results (property casing is Bus count)
Departurestring (datetime)✓Departure datetime of the search
Originstring✓Origin city name
Origin Terminalstring✓Origin terminal or airport
Routestring✓Route by city name
productenum✓Product 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
Destinationstring✓Destination city name
Destination Terminalstring✓Destination terminal
Originstring✓Origin city name
Origin Terminalstring✓Origin terminal
Pricenumber (positive)✓Seat / segment price
Routestring✓Route by city name
Ticketsinteger (positive)✓Number of tickets
Transporterstring✓Transporter name
Wayenum✓'Departure' or 'Return'
productenum✓Product 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 Countinteger✓Number of passengers
Totalnumber✓Total amount
productenum✓Product 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 Countinteger✓Number of passengers
Trip Countinteger✓Number of trips
Payment Typestring✓Selected payment type
Totalnumber✓Total amount
productenum✓Product 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 Countinteger✓Number of passengers
Trip Countinteger✓Number of trips
Totalnumber✓Total amount
productenum✓Product 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
Destinationstring✓Destination city name
Destination Terminalstring✓Destination terminal
Originstring✓Origin city name
Origin Terminalstring✓Origin terminal
Pricenumber (positive)✓Price
Result Positioninteger✓Position of the result in the list
Routestring✓Route by city name
Stopsinteger (non-negative)✓Number of stops
Transport Typestring✓Transport type
Transporterstring✓Transporter name
productenum✓Product channel: web, web-mobile, ios, android, app
Recommended Tripboolean✓Whether the trip is recommended
Trip Typestring✓Trip type
Bus Typestring✓Bus 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 Idstring✓Operation identifier
productenum✓Product 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

Purchase Confirmation Viewed

Triggered when the user views the purchase confirmation.

  • Method: analytics.track.purchaseConfirmation(props, meta?)
  • Props type: PurchaseConfirmationProps
  • Schema is strict (unknown top-level keys are rejected).
ParameterTypeRequiredDescription
Operation Idstring (min 1)✓Purchase operation identifier
Payment Statusenum✓Payment status: confirmed or pending_pix
Payment TypestringPayment method or type
TotalnumberPurchase total

Geolocation Selected

Triggered when the user selects a geolocation.

  • Method: analytics.track.geolocationSelected(props, meta?)
  • Props type: GeolocationSelectedProps
ParameterTypeRequiredDescription
Selected Citystring✓Selected city name
Selected Country Codestring✓Selected 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 Destinationstring✓Departure destination city
Departure Destination Terminalstring✓Departure destination terminal
Departure Linestring✓Departure line
Departure Originstring✓Departure origin city
Departure Origin Terminalstring✓Departure origin terminal
Departure Pricenumber✓Departure price
Departure Routestring✓Departure route
Departure Stopsinteger✓Departure stops
Departure Timestring (date)✓Departure time
Departure Transport Typestring✓Departure transport type
Departure Transporterstring✓Departure transporter
Recommended Tripboolean✓Whether 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 Seatstring✓Passenger seat
Passenger Namestring✓Passenger name
Passenger Document Typestring✓Document type
Passenger Document Idstring✓Document id