Everything that follows is about having it embedded in your site, with the
booking form inside your own website. If your guests book on the page Restoo
hosts for you there is no code to write: what you configure and where is in Hosted
Restoo, at the end of the page.
Restoo.js API
The widget shows up in three ways, and each one has its own value in code. Here and in the events you will see them like this:
Every method returns the instance, so calls can be chained. And where a value only
accepts letters, digits, hyphens, and underscores (
[a-zA-Z0-9-_]), it is noted.
Full example
Everything the API exposes, together in one installation: a named widget instance, all five.create() parameters, and a custom trigger attribute. The rest of this section covers each piece
on its own, and you don’t need all of it — only what your integration needs.
window.Restoo(account, settings?)
Creates a widget instance. Available as soon as the restoo:loaded event fires on window.
Parameters
string
required
Your Restoo Account ID — e.g.
"best-burger". Outside the accepted character
set it throws.string
Unique ID for this instance. It defaults to the
account value. Restoo adds
the restoo_ prefix, so widgetId: "w-reservations" appears as
"restoo_w-reservations" in source.widget_id on Restoo Widget
Events.create(), mount(), bindTriggers(), and setConsent().
.create(settings?)
Optional. Configures the instance before it mounts — if you don’t need to customize anything, call .mount() or .bindTriggers() directly and the widget will use its defaults.
object
How the widget behaves: its language, the view it opens on, and how it sits
inside your page.
object
Appearance for this instance only: it replaces your account’s entirely, it does
not tweak it. See Appearance for more information.
object
Destinations to switch off for this installation:
ga4, googleAds,
metaPixel, tiktokPixel, or gtm, each with the value false, the only one
accepted. Everything else about a destination comes from your account. See
Restoo Connect
for more information."COOKIEBOT" | "GOOGLE_CONSENT_MODE"
Consent management platform
installed on this page, which Restoo reads the visitor’s decision from. Omitting it means consent arrives only through
setConsent(). See
Consent for more information.object
Campaign attribution fixed for this installation: what you declare takes
precedence over the UTM parameters arriving in the visitor’s URL. Omitting it
keeps the normal behavior, where the attribution comes from that URL. See Forced
attribution for more information.
.mount(containerId)
Mounts the widget inside the given HTML element. Used for INLINE widgets.
string
required
The
id of your container element — e.g. "restoo-widget". Beyond the
accepted character set, it can’t start with a digit, start with a hyphen followed by a digit, or be
a single hyphen. Accented or non-Latin ids such as "menú" or "café-2" are
rejected — rename the element or give it a plainer id for the widget..bindTriggers(settings?)
Switches the instance to OVERLAY mode and registers elements carrying data-restoo-open (or a custom attribute) as click triggers. The widget mounts lazily the first time a user clicks; subsequent clicks navigate directly without remounting.
string
default:"data-restoo-open"
HTML attribute used as the trigger — e.g.
"data-open-booking".It only accepts letters, digits, hyphens, underscores, and colons, and must
start with a letter; throws otherwise.view option to send visitors straight to that
part of the widget.
.setConsent(signals)
Optional if you declared your consent platform with cmp, since Restoo already reads that platform. Informs Restoo of the visitor’s consent, using Google Consent Mode v2 signal names and values.
Call it from your cookie notice, whenever the visitor accepts, rejects, or changes their decision.
object
required
One or more of the seven Google Consent Mode v2 signals. Each value must be
exactly
"granted" or "denied". See
Consent for what each signal means, how it
accumulates across calls, and what it unlocks.Deep linking
The widget mirrors the view it is on into your page’s URL, inside a?restoo_widgets= parameter. That turns the address into a link you can share or bookmark: opening it starts the widget on the saved view instead of its default.
It works in both modes, with one difference:
You don’t have to build those URLs by hand: the widget writes the parameter on its own as the visitor navigates, and your page only has to keep it if you link to it or share it.
Screens that identify a booking or its guest are never written to your
page’s URL, so they are not saved and cannot be linked to. A page URL
travels — into your analytics, into a shared link, into a browser history —
and the guest’s data has no business travelling with it.
Forced attribution
Some installations do not want the visitor’s URL to decide the attribution, because the page itself is the channel. A booking portal that partners with the business is the usual case: the business wants to measure how many reservations that portal sends, and every booking made there belongs to it whatever brought the visitor to the portal in the first place. Declare those values asutmTags and every booking and every event from that installation carries them. It is a forced attribution: what you declare wins over anything the visitor’s URL brings.
- Immutable — UTM parameters arriving in the URL cannot overwrite it, and neither can values remembered from an earlier visit through Restoo Attribution Transfer.
- Complete — the declared set replaces the attribution as a whole: a field you leave out is never taken from the URL, so two different touches don’t end up mixed into one record. Declaring only
utmSourcegives every booking that source and no campaign, with the medium falling back to the default.
A forced attribution needs no consent. These values are part of your
installation rather than information read from the visitor’s device, so nothing
is stored on it and nothing has to be asked. They are never written to
localStorage either: a later visit through a different entry point is
attributed on its own.Technical notes
What Restoo.js does on your page
What Restoo.js does on your page
The snippet from the Quickstart loads Restoo.js (
restoo-widget) from your
account’s Restoo subdomain. Restoo.js:- Adds the
window.Restoo()function to your page, then dispatches arestoo:loadedevent onwindowto signal that it is ready to use. - Creates an
<iframe>pointing to your Restoo subdomain and renders the booking app inside it — on.mount(), or on the visitor’s first click when you use.bindTriggers(). - Keeps the parent page and the widget in sync automatically — resizing the
INLINEembed to fit its content, forwarding Restoo Widget Events towindow, and syncing browser back/forward navigation.
How Restoo.js loads
How Restoo.js loads
Restoo.js must be loaded with
type="module". Because module scripts are deferred,
always initialize your widget from inside a restoo:loaded listener rather than immediately
after the <script> tag — otherwise window.Restoo may not exist yet.Modal presentation (mobile vs. desktop)
Modal presentation (mobile vs. desktop)
On mobile, the modal — the
OVERLAY value — takes the full screen. On desktop, it’s a
centered floating panel over a dark backdrop. This is automatic; the only part
you can customize is the panel’s own colors, via colorWidgetBackground /
colorWidgetForeground — see Appearance.Multiple widgets on one page
Multiple widgets on one page
You can mount as many
OVERLAY/INLINE widgets as you need on the same page
— give each one a distinct widgetId if they share the same account.
Deep-linking state (?restoo_widgets=) and browser back/forward navigation
are tracked independently per widget.Content Security Policy (CSP)
Content Security Policy (CSP)
A Content Security Policy is a rule your server sends telling the browser which
outside domains a page is allowed to use. Most sites don’t have one — if
you’re not sure, ask whoever maintains your site. If yours does, it needs to
allow three things for the widget, added to the directives you already have:
An
INLINE widget also needs inline scripts allowed — a nonce, a hash, or
'unsafe-inline' — because the resizer is loaded through a small inline
<script> tag. Allowing the cdn.jsdelivr.net domain on its own is not
enough. Without it the widget works, but stops adjusting its height to fit its
content. OVERLAY widgets don’t resize, so they’re unaffected.Hosted on Restoo
The widget hosted on Restoo has these configuration options.In your Restoo account
Saved once, and they apply to every one of your links:- Appearance — your colors, your fonts, your style.
- The platforms you measure on — GA4, Google Ads, Meta Pixel, TikTok Pixel, and OpenAI Pixel.
In the link
The language, the view it opens on, and the campaign the booking is credited to:What doesn’t exist with the widget hosted by Restoo. There is no installation declaring
anything, so there is no per-installation
appearance or connect, no
cmp and no setConsent() — the cookie
notice is ours — no utmTags, and no bindTriggers(). And since the widget
doesn’t live inside your site, there is nothing to adjust about CSP, autoscroll,
or height.Next steps
Appearance
Match the widget to your brand: colors, fonts, and corner radii.
Restoo Connect
Send booking events to GA4, Google Ads, Meta, TikTok, ChatGPT Ads, and GTM automatically.