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 lowercaseproduct. - 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 name | Method | Props type |
|---|---|---|
| Interest In Home | interestInHome | InterestInHomeProps |
| Interest In Search | interestInSearch | InterestInSearchProps |
| Search | search | SearchProps |
| View Results | viewResults | ViewResultsProps |
| Seat Change | seatChange | SeatChangeProps |
| Passengers Created | passengersCreated | PassengersCreatedProps |
| Payment Attempt | paymentAttempt | PaymentAttemptProps |
| Purchase Attempt | purchaseAttempt | PurchaseAttemptProps |
| Picked Departure | pickedDeparture | PickedDepartureProps |
| Purchase Canceled | purchaseCanceled | PurchaseCanceledProps |
| Geolocation Selected | geolocationSelected | GeolocationSelectedProps |
| (caller-supplied name) | customEvent | CustomEventProps |
Interest In Home
Triggered when the user accesses the home page.
- Method:
analytics.track.interestInHome(props, meta?) - Props type:
InterestInHomeProps
| Parameter | Type | Required | Description |
|---|---|---|---|
product | enum | ✓ | Product channel: web, web-mobile, ios, android, app |
Interest In Search
Triggered when the user interacts with the search functionality.
- Method:
analytics.track.interestInSearch(props, meta?) - Props type:
InterestInSearchProps
| Parameter | Type | Required | Description |
|---|---|---|---|
product | enum | ✓ | Product channel: web, web-mobile, ios, android, app |
Origin | string | Origin city name | |
Destination | string | Destination city name | |
Departure | string (date) | Departure date | |
Return | string (date) | Return date | |
Departure Date | string | Departure date as free-form string |
Search
Triggered when the user performs a search.
- Method:
analytics.track.search(props, meta?) - Props type:
SearchProps
| Parameter | Type | Required | Description |
|---|---|---|---|
Departure | string (date/datetime) | ✓ | Departure date of the search |
Departure Delta | integer | ✓ | Days between now and the searched trip |
Destination | string | ✓ | Destination city name |
Destination Terminal | string | ✓ | Destination terminal or airport |
Origin | string | ✓ | Origin city name |
Origin Terminal | string | ✓ | Origin terminal or airport |
Passengers | integer | ✓ | Number of passengers in the search |
Route | string | ✓ | Route by city name (e.g. Ciudad de México - Querétaro) |
product | enum | ✓ | Product channel: web, web-mobile, ios, android, app |
Return | string (date/datetime) | Return date | |
Trip Length | number (positive) | Trip duration; only meaningful when a return date is provided | |
Categories | string[] | Search categories |
View Results
Triggered when search results are displayed.
- Method:
analytics.track.viewResults(props, meta?) - Props type:
ViewResultsProps
| Parameter | Type | Required | Description |
|---|---|---|---|
Bus count | integer | ✓ | Number of buses in the results (property casing is Bus count) |
Departure | string (datetime) | ✓ | Departure datetime of the search |
Origin | string | ✓ | Origin city name |
Origin Terminal | string | ✓ | Origin terminal or airport |
Route | string | ✓ | Route by city name |
product | enum | ✓ | Product channel: web, web-mobile, ios, android, app |
Departure Delta | integer | Days between now and the searched trip | |
Destination | string | Destination city name | |
Destination Terminal | string | Destination terminal or airport | |
Has Frequent Buses | boolean | Whether 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
| Parameter | Type | Required | Description |
|---|---|---|---|
Arrival | string (date/datetime) | ✓ | Arrival date or datetime |
Departure | string (date/datetime) | ✓ | Departure date or datetime |
Destination | string | ✓ | Destination city name |
Destination Terminal | string | ✓ | Destination terminal |
Origin | string | ✓ | Origin city name |
Origin Terminal | string | ✓ | Origin terminal |
Price | number (positive) | ✓ | Seat / segment price |
Route | string | ✓ | Route by city name |
Tickets | integer (positive) | ✓ | Number of tickets |
Transporter | string | ✓ | Transporter name |
Way | enum | ✓ | 'Departure' or 'Return' |
product | enum | ✓ | Product channel: web, web-mobile, ios, android, app |
Line | string | Line name | |
Stops | integer (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).
| Parameter | Type | Required | Description |
|---|---|---|---|
Trips | trip object[] (min 1) | ✓ | Trip objects; see Trip schema |
Passenger Count | integer | ✓ | Number of passengers |
Total | number | ✓ | Total amount |
product | enum | ✓ | Product channel: web, web-mobile, ios, android, app |
Trip Count | integer | Number of trips | |
Passengers | passenger 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).
| Parameter | Type | Required | Description |
|---|---|---|---|
Trips | trip object[] (min 1) | ✓ | Trip objects; see Trip schema |
Passenger Count | integer | ✓ | Number of passengers |
Trip Count | integer | ✓ | Number of trips |
Payment Type | string | ✓ | Selected payment type |
Total | number | ✓ | Total amount |
product | enum | ✓ | Product channel: web, web-mobile, ios, android, app |
Operation Id | string | Operation identifier | |
Passengers | passenger object[] (min 1) | Passenger objects; see Passenger schema | |
Insurance | boolean | Whether insurance is included | |
Coupon | string | Promotional coupon | |
User Status | string | User 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).
| Parameter | Type | Required | Description |
|---|---|---|---|
Trips | trip object[] (min 1) | ✓ | Trip objects; see Trip schema |
Passenger Count | integer | ✓ | Number of passengers |
Trip Count | integer | ✓ | Number of trips |
Total | number | ✓ | Total amount |
product | enum | ✓ | Product channel: web, web-mobile, ios, android, app |
Operation Id | string | Operation identifier | |
Passengers | passenger 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
| Parameter | Type | Required | Description |
|---|---|---|---|
Arrival | string (datetime) | ✓ | Arrival datetime |
Departure | string (datetime) | ✓ | Departure datetime |
Destination | string | ✓ | Destination city name |
Destination Terminal | string | ✓ | Destination terminal |
Origin | string | ✓ | Origin city name |
Origin Terminal | string | ✓ | Origin terminal |
Price | number (positive) | ✓ | Price |
Result Position | integer | ✓ | Position of the result in the list |
Route | string | ✓ | Route by city name |
Stops | integer (non-negative) | ✓ | Number of stops |
Transport Type | string | ✓ | Transport type |
Transporter | string | ✓ | Transporter name |
product | enum | ✓ | Product channel: web, web-mobile, ios, android, app |
Recommended Trip | boolean | ✓ | Whether the trip is recommended |
Trip Type | string | ✓ | Trip type |
Bus Type | string | ✓ | Bus type |
Line | string | Line name | |
Recommended Trip Type | string | Recommended trip type |
Purchase Canceled
Triggered when a purchase is canceled.
- Method:
analytics.track.purchaseCanceled(props, meta?) - Props type:
PurchaseCanceledProps
| Parameter | Type | Required | Description |
|---|---|---|---|
Operation Id | string | ✓ | Operation identifier |
product | enum | ✓ | Product channel: web, web-mobile, ios, android, app |
Trips | trip object[] (min 1) | Trip objects; see Trip schema | |
Passenger Count | number | Number of passengers | |
Total | number | Total amount | |
Trip Count | number | Number of trips | |
Passengers | passenger 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
| Parameter | Type | Required | Description |
|---|---|---|---|
Selected City | string | ✓ | Selected city name |
Selected Country Code | string | ✓ | 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(foreventData)
| Parameter | Type | Required | Description |
|---|---|---|---|
eventName | string (min 1) | ✓ | Mixpanel event name (first argument, not part of CustomEventProps) |
eventData | CustomEventProps | Record whose values are primitives (string, boolean, number, undefined) or arrays of those primitives | |
meta | EventMetadata | Optional 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
Departure Arrival | string (date) | ✓ | Departure arrival datetime |
Departure Destination | string | ✓ | Departure destination city |
Departure Destination Terminal | string | ✓ | Departure destination terminal |
Departure Line | string | ✓ | Departure line |
Departure Origin | string | ✓ | Departure origin city |
Departure Origin Terminal | string | ✓ | Departure origin terminal |
Departure Price | number | ✓ | Departure price |
Departure Route | string | ✓ | Departure route |
Departure Stops | integer | ✓ | Departure stops |
Departure Time | string (date) | ✓ | Departure time |
Departure Transport Type | string | ✓ | Departure transport type |
Departure Transporter | string | ✓ | Departure transporter |
Recommended Trip | boolean | ✓ | Whether the trip is recommended |
Return Arrival | string (date) | Return arrival datetime | |
Return Destination | string | Return destination city | |
Return Destination Terminal | string | Return destination terminal | |
Return Line | string | Return line | |
Return Origin | string | Return origin city | |
Return Origin Terminal | string | Return origin terminal | |
Return Price | number | Return price | |
Return Route | string | Return route | |
Return Stops | integer | Return stops | |
Return Time | string (date) | Return time | |
Return Transport Type | string | Return transport type | |
Return Transporter | string | Return transporter | |
Recommended Trip Type | string | Recommended trip type |
Passenger schema
Used when a Passengers array is present. Schema is strict.
| Parameter | Type | Required | Description |
|---|---|---|---|
Passenger Birthdate | string (date) | ✓ | Passenger birthdate |
Passenger Seat | string | ✓ | Passenger seat |
Passenger Name | string | ✓ | Passenger name |
Passenger Document Type | string | ✓ | Document type |
Passenger Document Id | string | ✓ | Document id |