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: |
placement | Required | String | Name of booking stage or page the element is embedded on. Used for measuring engagement in analytics reports.
|
segments | Optional | Array of Objects | |
travellers | Optional | Array of Objects | |
queryParams | Optional | Object | |
features | Optional | Object | |
cookieConsentPreferences | Optional | Array of Strings | An optional list of cookie consent type names that constitute a cookie policy that should apply to this Element (and to all other existing or future Embedded Elements or Application Widgets). See Setting a Cookie Policy for a list of valid cookie consent type names. If no cookie consent preference is specified, the new Element will use the most recently specified cookie policy (set either when creating a previous Embedded Element or Application Widget or by using the setCookiePreferences() method on the SDK). If there is no previously specified cookie policy, a minimal cookie policy will be employed that allows only those cookies that are needed for the Element to function. |
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 | Direction of the flight. |
segmentSubType | Required for connecting flight. | String | Is this a connecting flight. |
origin | Optional if | Object | |
destination | Optional if | Object | |
travelMode | Optional | String | Default: |
departureDate | Optional. If omitted, this date will default to the current day for | String | Date of departure |
departureTime | Optional | String | Time of departure |
arrivalDate | Optional. If omitted, this date will default to the current day for | String | Date of arrival |
arrivalTime | Optional | String | 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 |
Vaccination Model
Attribute | Required | Type | Description |
---|---|---|---|
type | Optional | String | Currently only value 'COVID_19' |
status | Optional | String | 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: |
utm_medium | Optional | String | UTM medium. Example: |
utm_campaign | Optional | String | UTM campaign. Example: |
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 |
showTitle | Optional | Boolean | Show/hide title |
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 |
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.
Updated 3 months ago