Skip to main content
This page assumes you’ve already completed the Installation Quickstart. It covers everything beyond that basic setup: the Restoo.js API, deep linking, forced attribution, the technical notes, and the options of hosted on Restoo. To customize colors and fonts, see Appearance.
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.
Returns a widget instance with create(), mount(), bindTriggers(), and setConsent().
Set widgetId explicitly when you mount more than one widget instance on the same page for the same account — for example, two separate booking forms with different initial views. Each widgetId gets its own isolated state.

.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.
Parameters
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.
Parameters
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.
Parameters
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.
Usage in HTML: The attribute’s value is the view the overlay opens on. Leave it empty to open the default view, or set any of the values accepted by the 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.
Parameters
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 as utmTags 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.
What you declare is immutable and complete:
  • 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 utmSource gives every booking that source and no campaign, with the medium falling back to the default.
Anything that is not one of the five fields above, or that carries an empty value, is ignored — with a warning in the browser console naming what was dropped.
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

The snippet from the Quickstart loads Restoo.js (restoo-widget) from your account’s Restoo subdomain. Restoo.js:
  1. Adds the window.Restoo() function to your page, then dispatches a restoo:loaded event on window to signal that it is ready to use.
  2. 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().
  3. Keeps the parent page and the widget in sync automatically — resizing the INLINE embed to fit its content, forwarding Restoo Widget Events to window, and syncing browser back/forward navigation.
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.
When a visitor navigates between internal widget pages (e.g. calendar → form → confirmation), an INLINE widget asks the parent page to scroll its container into view — but only if the top of the container isn’t currently visible, so it never scrolls unnecessarily. The initial page load never triggers this.If your site has a sticky/fixed header that would cover the top of the widget, set scroll-margin-top on your container to match its height:
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.
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:
connect-src fails quietly, so it’s worth double-checking. Without it the widget still loads and still takes bookings, but it can’t read your account settings: your brand colors and fonts fall back to the defaults, and the analytics destinations configured for your account never activate. No error appears anywhere — the widget simply doesn’t look or report like it should.
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.
Any change applies from the next page load, with nothing to deploy. Here Restoo handles measurement end to end: it installs those platforms’ tags and asks for consent with its own cookie notice. There is nothing for you to add. Restoo Connect explains how it works. The language, the view it opens on, and the campaign the booking is credited to:
That way you can keep several links at once: one in English for your international guests, another that opens the gift card store directly.
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.