Configuration Model

Customize Trip Element for your needs

Configure Trip Element

The Trip Element can be customized through a configuration object that is included at the time of element creation.

const elementConfig = {
  ...
}

$sherpa.V2.createElement('trip', elementConfig).mount('#sherpa-widget')

Configuration Model

Attribute

Required

Type

Description

language

Optional

String

default: en-US
View supported languages

placement

Required

String

Name of booking stage or page the element is embedded on. Used for measuring engagement in analytics reports.
Suggested values in camelCase:
homePage - Home Page
discovery - Generic pre-booking marketing page
mmb - Manage My Booking
search - Search
bookingConfirmation - Booking Confirmation
destinationPage - dedicated marketing page for a destination
covidPage - dedicated page for COVID-19 resources

segments

Optional

Array of Objects

View Segment Model

travellers

Optional

Array of Objects

View Traveller Model

queryParams

Optional

Object

View Analytics Model

features

Optional

Object

View Features Model

Segment Model

Describe the trip using a set of SegmentSegment - A part of a trip between two successive stops. A return trip consists of two segments.s.

Attribute

Required

Type

Description

segmentType

Required

String
OUTBOUND, RETURN

Direction of the flight.

segmentSubType

Required for connecting flight.

String
TRANSIT

Is this a connecting flight.

origin

Optional if features.showResults is false;
Required otherwise

Object

View Location Model

destination

Optional if features.showResults is false;
Required otherwise

Object

View Location Model

travelMode

Optional

String
AIR

Default: AIR

departureDate

Optional. If omitted, this date will default to the current day for OUTBOUND segmentTypes and to one week from the current day for RETURN segmentTypes.

String
YYYY-MM-DD

Date of departure

departureTime

Optional

String
HH:MM:SS

Time of departure

arrivalDate

Optional. If omitted, this date will default to the current day for OUTBOUND segmentTypes and to one week from the current day for RETURN segmentTypes.

String
YYYY-MM-DD

Date of arrival

arrivalTime

Optional

String
HH:MM:SS

Time of arrival

Location Model

One of the following attributes is required.

Attribute

Required

Type

Description

countryCode

Optional, if one other is specified

String

ISO3 Country CodeISO3 Country Code - A country code in an ISO3 Format. For example, `USA`, `CAN`, `DEU`., e.g. CAN for Canada

airportCode

Optional, if one other is specified

String

IATA Airport Code e.g. YYZ for Pearson International Airport, Toronto, Canada

regionCode

Optional, if one other is specified

String

alpha3 Region CodeRegion Code - ISO 3166-2 region code e.g. US-TX for Texas, USA

Traveller Model

Attribute

Required

Type

Description

nationality

Optional

String

ISO3 Country CodeISO3 Country Code - A country code in an ISO3 Format. For example, `USA`, `CAN`, `DEU`., e.g. CAN for Canada

vaccinations

Optional

Array of Objects

View Vaccination Model

Vaccination Model

Attribute

Required

Type

Description

type

Optional

String

Currently only value 'COVID_19'

status

Optional

String
FULLY_VACCINATED, NOT_VACCINATED

Indication of being fully vaccinated or not

Analytics Model

Pass analytics attributes to the segment element. The parameters will be appended to the iFrame url where the Trip Element is rendered, and appear in your reports.

Attribute

Required

Type

Description

utm_source

Optional

String

UTM source. Example: email

utm_medium

Optional

String

UTM medium. Example: newsletter

utm_campaign

Optional

String

UTM campaign. Example: summer-return-to-travel

Features Model

Customize the appearance of the Trip Element by enabling and disabling feature flags.

Attribute

Required

Type

Description

showSegments

Optional

Boolean

Show/hide navigation between segments
Default: true

showTitle

Optional

Boolean

Show/hide title
Default: true

enableSegmentEditor

Optional

Boolean

Show/hide the UI to edit a trip, including "Edit my trip" button.

showFilterNationality

Optional

Boolean

Show/hide Select Passport UI

showFilterVaccinated

Optional

Boolean

Show/hide Vaccination Toggle UI

showFilterConnection

Optional

Boolean

Show/hide option of choosing a connecting flight

showResults

Optional

Boolean

Show/hide travel restrictions results on load
Default: true

❗️

showResults Feature

showResults is 'True' by default, if this is true origin and destination has to be specified. Set this to 'false' to load the widget with no destination and origin specified.


Did this page help you?