How it works

From one script tag to a working booking section

No build step, no server of your own and no account on your site. Add the loader, place the widgets you want and decide what happens when a guest picks a room.

Install

Three steps

Each step is one line.

  1. 01 Add the script

    Paste one line

    Add the loader once, before the closing body tag. It is small, sets no cookies and works on any page.

    Code
    <script src="https://embeds.example.com/embed/stay.js" async></script>
    Read the guide
  2. 02 Place a widget

    Add an empty element

    Put a div where a section should appear and name the widget and your hotel. It fills in and grows to fit its content.

    Code
    <div data-stay="rooms" data-hotel="your-hotel" data-layout="bento"></div>
    Browse the widgets
  3. 03 Guests choose

    Take it from there

    Every choice is an event on your page. Send guests to your booking engine with the stay filled in, handle it yourself, or let the platform take the booking.

    Code
    StayEmbed.on('select', (e) => console.log(e.detail.roomName, e.detail.total))
    How hand-off works

Design

Make it yours

Four settings give a widget your look: an accent, ink and paper colour and a corner style, plus a headline font and a light or dark scheme. Set them once on the hotel, or override them on any widget.

After the guest chooses

You decide what happens next

When a guest picks a room and a rate, the hotel chooses one of four behaviours. Nothing changes on your page.

  • Send them to your booking engine

    The guest lands on your engine's page with the room, dates, guests and rate already filled in.

    Example
    https://book.example.com/?room={room}&checkin={checkin}&checkout={checkout}&adults={adults}

    Best when you already use a booking engine.

  • Tell your own page

    The widget sends an event with the whole stay and does nothing else. Your code opens your own form or basket.

    Example
    StayEmbed.on('reserve', (e) => openMyBasket(e.detail))

    Best when you have your own checkout.

  • Take the booking here

    The platform checks the stay, holds the room, takes a deposit on Stripe's page, confirms the booking and emails the guest and the hotel.

    Example
    Hand-off      Take the booking here
    Payments      Stripe, 25% deposit
    Room held     30 minutes

    Best when you have no booking engine.

  • Use the demo checkout

    A short form and a confirmation screen so you can see the whole flow. Nothing is saved, emailed or charged.

    For demos and testing, not for taking bookings.

Taking bookings

Take the booking and the deposit yourself

With no booking engine, the platform can take the booking: it checks the stay, holds the room, collects a deposit on Stripe's page, confirms the booking and emails the guest and the hotel. Four things to set up, once.

  1. 01 Stripe

    Add your Stripe key, or let us collect

    Choose Stripe as the payment provider and paste your secret key, so deposits are paid straight to you. A test key (sk_test_…) takes test payments only, so try card 4242 4242 4242 4242 with any future date first. No Stripe account? Leave the key empty and we collect your deposits and pay you once a month.

    Code
    Payments        Stripe
    Secret key      sk_test_…
  2. 02 Webhook

    Tell Stripe where to report

    In Stripe's dashboard, add this address as a webhook endpoint, send it checkout.session.completed, checkout.session.expired and charge.refunded, and paste its signing secret into the hotel's record. Only messages signed with it are believed.

    Code
    https://embeds.example.com/wp-json/stay/v1/stripe
  3. 03 Email

    Choose your emails

    In your dashboard, open Emails and switch each one on or off: a confirmation, a cancellation and refund notice, a reminder the day before arrival, a thank you after the stay and your own notices. Choose the name your guests see and where their replies go, and send yourself an example of any of them first.

    Code
    Confirmation to the guest   on
    Reminder before arrival     on
    Thank you after the stay    off
    Booking notice to you       front-desk@your-hotel.com
  4. 04 Deposit

    Choose what is paid now

    A percentage of the stay, the first night or a fixed amount. We suggest 25%: it keeps card fees small, because they apply to the deposit only, and the guest pays the rest at the hotel. Prepaid rates are paid in full. If a guest does not arrive, the deposit is not refunded. The room is held while the guest pays.

    Code
    Deposit         25% of the stay
    Room held       30 minutes

Events

Listen to what guests do

Every choice is an event on your page. Listen with the loader, with a DOM event, or send them to Google Tag Manager by adding one attribute.

Three ways to listen
// 1. The loader's API
StayEmbed.on('select', (e) => console.log(e.detail.roomName, e.detail.total))

// 2. A DOM event
window.addEventListener('stay:event', (e) => console.log(e.detail.type, e.detail.detail))

// 3. Google Tag Manager
<div data-stay="availability" data-analytics="dataLayer"></div>
EventWhenIn detail
readyA widget has loaded.widget, height
searchA guest chose dates or guests.checkin, checkout, nights, adults, children
selectA guest picked a room and a rate and pressed Reserve.hotel, room, roomName, rate, checkin, checkout, nights, adults, children, total, currency, offer, promo
reserveIn "tell my page" mode: the stay to book.the same as select
confirmThe demo checkout was confirmed.reference, room, checkin, checkout, total, currency, demo
openA widget asked for another widget to open in the overlay.widget, params

Integrations

Where it fits

Plain HTML is enough. For the places most sites are built, the package has a shortcut.

  • WordPress

    A one-file plugin adds shortcodes for every widget and a button that opens the booking overlay.

    WordPress
    [stay widget="rooms" hotel="your-hotel" layout="bento"]
    [stay_book_button hotel="your-hotel"]Book now[/stay_book_button]
  • React

    A small component loads the script once and mounts a widget. Props are the options.

    React
    <StayWidget widget="rooms" hotel="your-hotel" layout="bento" onEvent={(e) => track(e)} />
  • A plain iframe

    No script on your page? Use an iframe. It has a fixed height, so it cannot grow with its content or open the overlay.

    A plain iframe
    <iframe src="https://embeds.example.com/embed/rooms/?hotel=your-hotel&layout=grid" title="Rooms" loading="lazy" style="width:100%;height:1500px;border:0"></iframe>
  • Tag manager

    Add one attribute and every event is pushed to the data layer, ready for your analytics.

    Tag manager
    <div data-stay="availability" data-hotel="your-hotel" data-analytics="dataLayer"></div>

Reference

Options every widget understands

On an element they are data attributes; on an iframe they are query parameters. Each widget adds its own, shown on the widgets page.

OptionWhat it doesDefault
hotelWhich hotel (its slug).the default hotel
accent, ink, paperColours, as 6-digit hex without the #.the hotel's own
radiussharp, soft or round corners.the hotel's own
fontserif or sans headlines.the hotel's own
schemelight, dark or auto (follows the visitor).the hotel's own
bgtransparent to sit on your own page colour.solid
flush1 removes the outer padding, to line up with your own columns.off
hThe heading level the widget starts at (1 to 5), so it fits your page outline.2
title0 to hide the widget's own title.1
langA locale such as en-GB or de-DE for dates and money.the hotel's
height, height-smThe first height in pixels (and for an element under 640 px wide) before the widget reports its own.per widget
min-heightThe frame never shrinks below this.none
scrolloff stops the page scrolling to the widget after it changes screen.on
offsetPixels to leave above the widget when the page scrolls to it (a sticky header).0
analyticsdataLayer pushes every event to window.dataLayer.off

The package

Get the package

The loader, an example page for every widget, a complete example hotel website, a WordPress plugin, a React component and a written guide, in one zip.

  • The loader script
  • An example page for every widget
  • A whole example hotel website
  • A WordPress plugin with shortcodes
  • A React component
  • A guide to every option and event

stay-embed-package.zip

22 files, 27 KB

Download the package Read the guide

Plain files. Nothing to install on your server.