# The website widget: options, signals and JavaScript

> Every option the booking widget for your website takes, and the signals it gives your site. Also its small JavaScript API, prefilled names and emails, the colors, the way back from a card payment, and what a health business takes on.

The code from **Share & add to website** (its **Website** tab) loads one
script, `widget.js`, from Schedulign. Everything below is optional: the
code the dialog gives already works. Code pasted before October 26, 2026
keeps working as it did.

## The four ways it appears

- **On the page**: `<div data-schedulign-inline data-url="…/embed/your-page"><a href="…/your-page">Book online</a></div>`
  shows your booking page inside your page. The link inside it is a plain
  link to your booking page, which the widget replaces with the page itself.
  If your site's Content-Security-Policy or a visitor's blocker stops the
  script, visitors see that link, never an empty space. You can change its
  words, `Book online`, in the code you paste. It grows and shrinks with what it
  shows. After each step it brings its top on screen, below your site's own
  header if that header stays at the top. Inside a site builder's box of
  fixed height, it fills the box and scrolls inside it; `data-height="contained"`
  asks for that anywhere, and `data-height="auto"` lets it grow anyway.
- **Pop-up link**: `<a href="…/your-page" data-schedulign-popup data-url="…/embed/your-page">`
  opens your booking page over your site, in a window that takes your page's
  size. Escape, Close and a click beside it close it, and the keyboard stays
  inside it while it is open.
- **Floating button**: `<script src="…/widget.js" data-schedulign-widget data-url="…">`
  adds a button in a corner of every page. Its words, colors and corner come
  from `data-text`, `data-color`, `data-text-color` and
  `data-position="left"`. The attribute `data-offset="80"` raises it by 80 px,
  up to 400. On a phone it
  shows its icon alone, and it steps aside while an inline booking page on the
  same page is in view.
- **Any button**: `data-schedulign-open` on any element of your site opens the
  booking page over it. Its value is your page (`your-page`), an event
  (`your-page/intro-call`) or a link; left empty, the element's own `href`.
  Or add `data-schedulign-links="your-page"` to the script tag once. Then
  every link on your site to your booking page's full address opens it over
  your site, such as `https://www.schedulign.com/your-page` or one of its
  events. A builder's own buttons can then simply link to your page. Your
  site's other links, and links to other booking pages, stay as they are.
  Without JavaScript, the link still goes to your page.

## Colors and language

On every plan, a snippet takes `data-theme="dark"`, `data-theme="light"` or
`data-theme="auto"` (the visitor's phone or computer setting). An inline page
takes `data-background="transparent"` to drop its card's fill so your site's
background shows. Your accent color stays the same in each. The
booking page, the confirmation and the page clients use to change a booking
keep the look inside the widget. A frame you paste yourself takes the same as
`?theme=dark` and `?background=transparent` on its address.

The widget's own words (its button, Close) follow your page's language, or
the visitor's. The attribute `data-lang="es"` pins both them and the booking page to one
of English, Español, Français, Português (Brasil), Tiếng Việt and 简体中文.

## Prefilled name and email

A page of yours that knows its visitor can fill their name and email:
`data-prefill-name="Pat Lee" data-prefill-email="pat@example.com"` on the
snippet, or the API below. They fill the booking form's **Name** and
**Email** only while those are empty, the client can change them, and
nothing is sent until the client books. Nothing else is filled in: never
an answer to your questions. Under an email your page filled, the form
says "Filled in by this website", so the client checks it before booking. A
button without a prefill clears what another button filled.

## Signals your site can hear

The widget tells your page four things, which your own code can count:

- `ready`: the booking page has loaded.
- `event_viewed`: an event's page is shown.
- `time_selected`: the client picked a time.
- `booked`: a booking is made (confirmed at once, or paid). A time request
  sends nothing until it is approved.

A signal includes its name and, for `booked`, the booking's reference
(`sgn_` and 22 letters and digits): never the client's name, email or
answers, or the event's name. The reference opens nothing; it cannot change
or cancel the booking. The same booking always has the same reference, so a
page that gets it twice counts one booking.

Schedulign sends these signals to your page and to no one else, and runs no
analytics of its own on your site. If you pass them to an analytics or
advertising tool, that tool learns that a visitor booked with you. For a business whose services are health care under some states' laws,
that can be consumer health data (see Health information and your privacy
policy). It is yours to decide and to disclose.

## The JavaScript API

Add the first line before the widget's script, so calls made early wait for
it:

```html
<script>window.Schedulign = window.Schedulign || function () { (Schedulign.q = Schedulign.q || []).push(arguments); };</script>
<script>
  Schedulign("on", "booked", function (signal) {
    // signal.event is "booked"; signal.ref is the booking's reference.
  });
</script>
```

- `Schedulign("open", { url: "your-page/intro-call", prefill: { name: "Pat Lee", email: "pat@example.com" } })`
  opens a booking page over your site; without `url`, the first one your
  page's snippets name. `theme` and `lang` work as above.
- `Schedulign("on", "booked", fn)` (or `Schedulign.on`, once the script has
  loaded) calls `fn` for each signal of that name; `"*"` listens for all four. It
  returns a function that stops listening.
- `Schedulign("close")` closes the window it opened.
- `SchedulignWidget.open(address)` from older code still works.

## After booking, and after a card payment

A card payment opens Stripe's page in the same tab: Stripe's page never opens
inside another site. Your own website means the same site name as **Your
website** in **Settings → Profile**, with or without www, and not a subdomain
of it. When the widget sits there, Stripe brings the client back to that same
page, and the widget opens the confirmation inside it. If the client leaves
Stripe without paying, the widget opens the event with the time released. A page on a
social network, a link-in-bio page or a site many people share never
counts as your own website.
The address includes `?schedulign=` and a one-time code, which the widget
takes off the address at once. The code works once, for an hour, and only in the browser tab the client
booked in. It opens a confirmation that shows the booking without the
client's phone number or email address, and changes nothing. The link to change or cancel the booking
stays in the client's email. A browser that keeps the widget from storing
anything brings the client back to Schedulign's own confirmation instead,
and so does any other site, as before.

With **Page after booking** in **Settings → Branding**, a business's clients go
to a page of its own after booking. That page's address gets
`?booking=` and the booking's reference, never the link clients use to change
a booking. That link stays in the client's email. That page wins over the way
back above.

Source: https://www.schedulign.com/help/website-widget-reference (updated 2026-11-23)
