Install the script
Before you start
Ask the hotel for two things. Both are in Tape Chart Link, under Booking engine.
- The property number — nine digits. It is public: it goes into the script tag.
- Your site’s address on the list of allowed origins (Booking engine → Firewall), written like
https://www.yourhotel.com. Addhttp://localhost:3000there too while you develop. On a site that is not listed the script loads, but the browser refuses its requests.
The steps
-
Put the script on every page that shows a component, inside
<head>.<script src="https://link.tape-chart.com/widget/v1.js" data-property="YOUR_PROPERTY_NUMBER" defer></script> -
Make a booking page at
/bookingand put the booking window on it. The search form, the book buttons and every booking link lead here.<div data-pms-booking="window"></div> -
Make an account page at
/accountand put the guest area on it. Sign-in links in the hotel’s emails open here once the hotel has set this page as its account page (Booking engine → Configuration).<div data-pms-booking="portal"></div> -
Put a search form on the home page — the ready one, or your own form with our calendar.
<div data-pms-booking="search-form" data-promo="off"></div>
That is a working booking engine. Everything after this is choice: more components, your own markup, your own look.
Other paths
If your booking or account page lives somewhere else, say so on the script tag:
<script src="https://link.tape-chart.com/widget/v1.js" data-property="YOUR_PROPERTY_NUMBER" data-booking-path="/en/book" data-account-path="/en/my-stay" defer></script>The script tag’s attributes
| Attribute | Goes on | Values | What it does |
|---|---|---|---|
data-property | the script tag | 9 digits | Required. The property's public number. Without it the script draws nothing and logs a warning. |
data-booking-path | the script tag | a path — default "/booking" | The page of your site that carries the booking window. The search form, the book button, every data-pms-book link and bookUrl() lead there. |
data-account-path | the script tag | a path — default "/account" | The page of your site that carries the guest area. The account circle and the menu link there. |
data-theme | the script tag | "light" | "dark" | "auto" | "page" | The look the components start in. light or dark: that one. auto: the visitor's device. page: your site's own switch, followed live. Left out: light, unless the property's branding is dark. Except under page, a guest's pick on our theme icon wins. |
data-locale | the script tag | "en" | "bg" | The language of the components. Left out, they follow the page's own lang attribute, live. A guest's pick on our language icon wins over both. |
data-consent | the script tag | "granted" | "denied" | Your site's decision about marketing tags, for a page with no consent-manager script. window.pmsBookingConsent wins over it. |
data-analytics | the script tag | "off" | off: measure nothing at all on this site — no session, no events, no tags. |
data-assets-url | the script tag | a URL | Where the room photographs are loaded from. Normally left out: the property says where. |
data-base-url | the script tag | a URL on the script's own origin | Where the script calls our API. Honoured only when it is the origin the script itself was loaded from; anything else is ignored with a warning. Normally left out. |
Check that it works
- The browser console shows no warning from the script. A missing or wrong
data-propertylogs one and nothing is drawn. <html>carriesdata-pms-readyonce the script has bound the page.window.pmsBookingexists — see JavaScript.