Embed reference
Everything the loader script accepts. All settings are data- attributes on the script tag itself.
The script tag#
<script src="https://chat.nogeek.org/loader.js" async
data-destination="YOUR_PROPERTY_ID"
data-slug="your-property"></script>The loader reads its own attributes when it runs, so set them in the HTML rather than adding them later with JavaScript. It needs no other scripts and adds nothing to the global scope.
Attributes#
| Attribute | Values | Default | What it does |
|---|---|---|---|
data-destination | Property ID | Required | Which property the assistant works for. Without it the loader logs an error and shows nothing. |
data-slug | Text | Empty | The property's slug, which we give you with the ID. |
data-mode | bubble or inline | bubble | A chat button in the corner, or a chat window placed in the page. Any other value means bubble. |
data-target | CSS selector | None | Inline mode only. The element to put the chat in. If it's missing or matches nothing, the chat goes straight after the script tag. |
data-primary-color | Hex colour, 3 or 6 digits, with or without # | #0f766e | The main colour of the chat button and the chat. See Theming. |
data-launcher-label | Text | Need a hand? Chat to book | Bubble mode only. The teaser message shown next to the chat button. |
data-white-label | true | Off | Hides the Powered by line under the message box. Any value except 0 or false turns it on. |
data-consent | granted or denied | Not set | The visitor's choice about the optional visitor identifier. See Consent and storage. |
data-widget | chat or activity | chat | Mounts the booking assistant, or the activity booking widget. |
data-activity | Activity ID or slug | None | Activity widget only. Opens with this activity selected. |
data-secondary-color, data-text-color, data-background-color | Hex colour | None | Activity widget only. Extra theme colours. |
Bubble mode#
The default. The loader adds a round chat button, 60 pixels across, fixed to the bottom-right corner of the page.
- Clicking the button opens the chat in a panel above it, 400 by 640 pixels, kept within the window. Clicking again, or pressing Escape, closes it.
- On screens narrower than 480 pixels the chat opens full screen.
- When the assistant shows something larger, such as photos or a booking form, the panel can grow to 460 by 760 pixels.
- About four seconds after the page loads, a teaser message can appear next to the button, once, if the chat is still closed. If the guest dismisses it, it doesn't come back on that website. Whether it shows is set per property: see Teaser.
- The button and panel sit at a very high
z-index(2147483000) so they stay above page content. If your page has its own fixed element in the bottom-right corner, move it.
<script src="https://chat.nogeek.org/loader.js" async
data-destination="YOUR_PROPERTY_ID"
data-slug="your-property"
data-launcher-label="Check dates and prices"
data-white-label="true"></script>Inline mode#
The chat sits in the page, for example on a Book now page. It is open from the start.
- It fills the width of its container, up to 440 pixels, with rounded corners.
- It starts 560 pixels tall and then follows the height of the conversation, between 320 and 900 pixels.
- Inline mode has no chat button and no teaser.
<div id="book-chat"></div>
<script src="https://chat.nogeek.org/loader.js" async
data-destination="YOUR_PROPERTY_ID"
data-slug="your-property"
data-mode="inline"
data-target="#book-chat"
data-white-label="true"></script>Activity booking widget#
For properties that sell timed activities, such as tours, classes or sessions, data-widget="activity" mounts a booking widget instead of the chat. Guests pick an activity, a day and a time slot, and pay in the widget. It works best inline, in a space about 440 by 640 pixels.
<div id="book-activity"></div>
<script src="https://chat.nogeek.org/loader.js" async
data-destination="YOUR_PROPERTY_ID"
data-slug="your-property"
data-widget="activity"
data-activity="ACTIVITY_ID_OR_SLUG"
data-mode="inline"
data-target="#book-activity"
data-white-label="true"></script>The booking assistant can also book activities in the chat, where the property sells them. The activity widget is for pages that only need the slot picker.
Several properties on one website#
Use one script tag per page. On a website that lists several properties, put the tag for the relevant property on each property's pages. Each property's website must be on its own allowed websites list.
Single-page apps#
The loader runs once, when the script loads. To change property when your app changes route, remove the old script tag and the elements with ids hfx-launcher, hfx-panel and hfx-teaser (or, in inline mode, the chat inside your target element), then add a new script tag.
Payments in the chat#
Where payment in the chat is set up, the chat runs in an iframe with allow="payment", so browser payment features such as card wallets can work in the payment step. If your website sets a Permissions-Policy header that blocks payment, wallets won't show.