Portal Widget
Installation
Create a widget instance by embedding the following code within your webpage inside the <body>
element:
<div id="Bs-PortalWidget"></div>
<script
id="booking-suedtirol-js"
src="https://widget.bookingsuedtirol.com/v2/bundle.js"
defer
></script>
<script>
document
.querySelector("#booking-suedtirol-js")
.addEventListener("load", () => {
BookingSüdtirol.Widgets.Portal("#Bs-PortalWidget", {
id: undefined,
lang: "de",
privacyURL: "/path/to/privacy/page",
termsURL: "/path/to/terms/page",
});
});
</script>
Include the <script … src="https://example.com/v2/bundle.js" …></script>
element exactly as specified. Do not self-host a copy of the script and do not include its code into a JavaScript bundle file. Otherwise the widget will not work correctly.
Configuration
Use BookingSüdtirol.Widgets.Portal(domElement, settings)
to create new widget instances.
Method arguments
domElement
: string | DOM element
The CSS selector or DOM element where your widget will be mounted.
settings
: object
Initialization options. See API below. Each widget instance can have it's own settings.
URL parameters
The following list of settings can also be passed over the URL
.
lang
arrival
departure
locationId
propertyId
guests
sortId
classificationIds
classificationCodes
equipmentIds
subjectIds
showFavorites
offset
utm_medium
utm_source
utm_campaign
Notice that URL parameters always overwrite widget instance settings.
// Example
https://www.example.com/?lang=it&arrival=2022-02-20&departure=2022-02-23&guests=[[18,18],[18,4]]
API
id
: string
The widget ID
Mandatory field
privacyURL
: string
Defines the URL to the privacy policy page of the website where the widget is embedded. The language used on the page must match the lang
field.
Examples:
/en/privacy
https://example.com/en/privacy
Mandatory field
termsURL
: string
Defines the URL to the general terms and conditions page of the website where the widget is embedded. The language used on the page must match the lang
field.
Examples:
/en/terms
https://example.com/en/terms
Mandatory field
lang
: string?
Language
de
: German (default)it
: Italianen
: English
googleMaps
: object?
interface GoogleMaps {
apiKey?: string;
mapId?: string;
}
apiKey
This widget optionally uses the Google Maps JavaScript API in order to visualize search results in a comprehensive map view.
For this to work, it is required to create an API Key, that authenticates requests associated with your project for usage and billing purposes.
mapId
An optional map ID.
arrival
: string?
Defines the arrival date in ISO 8601 format (yyyy-MM-dd
)
2020-02-20
departure
: string?
Defines the departure date in ISO 8601 format (yyyy-MM-dd
)
2020-02-23
locationId
: number?
Searches for a specific location. Note that only locations with associated properties are displayed in the widget.
propertyId
: number?
Displays the detail page of a specific property.
accommodationId
: number
accommodationId
Deprecated. Use propertyId
instead.
guests
: number[][]?
Determines the number of rooms and their occupancy in the form of the age of each person.
18
: adult0-17
: child
// Examples
// room 1: 2 adults
[[18, 18]];
// room 1: 2 adults, 2 children (14 - and 5 years)
[[18, 18, 14, 5]];
// room 1: 2 adults
// room 2: 1 adult, 1 child (4 years)
[
[18, 18],
[18, 4],
];
// room 1: 2 adults
// room 2: 1 adult
// room 3: 2 adults, 1 child (3 years)
[[18, 18], [18], [18, 18, 3]];
// Produces error because no adults were submitted
[[12]];
// Produces error because more than three rooms were submitted
[[18], [18, 14], [18], [18]];
Default value: 2 adults [[18,18]]
Please note: You can add a maximum of three rooms.
sortId
: number?
Determines how search results are sorted.
0
: Random (default)1
: Category ascending2
: Category descending3
: Price ascending4
: Price descending5
: Rating ascending6
: Rating descending
classificationIds
: number[]?
Filter search results by classification.
1
: Hotel4
: Holiday home / residence16
: Bed and breakfast / apartments32
: Farm holiday64
: Mountain inn128
: Campground256
: Holiday home512
: Youth hostel1024
: Guest house2048
: Mountain refuge4096
: B&B hotel8192
: Inn
classificationCodes
: number[]?
Filter search results by classification code.
0
: Unrated1
: 12
: 23
: 3 and 3S4
: 4 and 4S5
: 5
featureIds
: number[]?
Filter search results by feature (equipment).
1
: garage2
: elevator4
: restaurant8
: fitness16
: spa256
: outdoor pool512
: indoor pool2048
: barrier - free4096
: internet8192
: shuttle Service16384
: child care16778240
: bar33587200
: pet allowed
themeIds
: number[]?
Filter search results by theme (subject).
1
: family2
: wellness4
: hiking8
: bike16
: cycling32
: golf64
: horseback riding128
: romantic256
: skiing512
: congress possibility1024
: cross country skiing2048
: city / culture4096
: snow shoe
showFavorites
: boolean?
Shows or hides bookmarked properties.
true
false
(Default)
offset
: number?
Controls the current pagination offset.
0
: Displays results from 1 to 101
: Displays results from 11 to 202
: Displays results from 21 to 303...
promotion
: [string | null, string | null, string | null]?
Enables you to customize the advertising fields medium (ResID_SourceContext)
, source (ResID_Source)
und campaign (ResID_Value)
and submit them to the PMS.
How exactly the fields are to be filled has been precisely defined in the AlpineBits Standard and can be read in the corresponding documentation in section 4.2.5 Implementation tips and best practice
.
["Advertising medium", "Advertising source", "Advertising campaign"];
Default value: [null, null, null]
The Google Analytics parameters utm_medium
, utm_source
, and utm_campaign
offer the possibility to submit the fields individually.
For example, the URL https://www.example.com/?utm_medium=metasearch&utm_source=tripadvisor.com&utm_campaign=tripadvisor_desktop
would submit ['metasearch', 'tripadvisor.com', 'tripadvisor_desktop']
to the PMS.
Using this feature will set a 30-day tracking cookie. In this case, add the cookie bs_widget_promotion
to your Privacy Policy. If you want to prevent the cookie from being set, insert the code window.BookingSüdtirolTrackingConsent = false;
before the widget is loaded.
propertyIds
: number[]
Enables you to display and order specific properties via their ID.
showSearch
: boolean?
Shows or hides search bar.
true
(Default)false
showFilters
: boolean?
Shows or hides filters bar.
true
(Default)false
Events
This widget does not fire any events.