The widget is one script served from `https://be.channelrush.net/widget/v1/channelrush.js`. It renders the whole booking flow (search → rooms → cart → extras → guest → payment → confirmation, plus "look up, change or cancel a booking") into a `<div>` on your page, inside Shadow DOM, so your site's CSS and the widget's CSS never interfere.

## The snippet

```html
<div data-crush-key="pk_live_xxxxxxxxxxxx"
     data-crush-lang="en-US"
     data-crush-currency="USD"
     style="--crush-primary:#0d47a1;"></div>
<script async src="https://be.channelrush.net/widget/v1/channelrush.js"
        data-cookieconsent="ignore" data-ot-ignore></script>
```

You get the key (`pk_live_…` / `pk_test_…`) from ChannelRUSH → Admin → CRS Settings → Booking Widgets. A key is bound to the domains you list there; the widget refuses to load anywhere else ("Booking widget not allowed on this site").

### Attributes on the `<div>`

| Attribute | Required | Meaning |
|---|---|---|
| `data-crush-key` | yes | Public key for the property. |
| `data-crush-lang` | no | Language, e.g. `en-US`, `de-DE`. Set it to the page's own language and the widget follows it with **no language selector**. Leave it out and the widget starts in the property's default language and shows a selector when the property offers several. |
| `data-crush-currency` | no | Initial currency (ISO 4217). Same rule. |
| `data-crush-mode="searchbar"` | no | Render only the search form; on submit send the visitor to `data-crush-target`. See [wix.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#wix). |
| `data-crush-target` | with searchbar | URL of the page that hosts the full widget. |
| `data-crush-room-type` | no | A room type id: the widget books **that room only**, for a widget on the room's own page. See [Booking on a room page](#booking-on-a-room-page). |
| `data-crush-fallback-url` | no | Your hosted booking page; shown as a link if the widget cannot load at all (blocked script, very old browser). |
| `data-crush-layout="compact"` | no | Force the compact layout used inside sandboxed iframes (auto-detected on Wix). |
| `style="--crush-…"` | no | Theme variables, see [theming.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#theming). |

### Script form (advanced)

```html
<script src="https://be.channelrush.net/widget/v1/channelrush.js" data-cookieconsent="ignore" data-ot-ignore></script>
<script>
  ChannelRUSH.init({ key: 'pk_live_xxxxxxxxxxxx', el: '#book-here', language: 'en-US', currency: 'USD',
                     theme: { primary: '#0d47a1' }, onEvent: (name, detail) => console.log(name, detail) });
</script>
```

`window.ChannelRUSH` is the only global: `init(options)`, `destroy(el?)`, `version`. Under a strict CSP the second, inline `<script>` needs your own nonce/hash; prefer the declarative form.

## Testing against the test server

To try the widget against the ChannelRUSH test environment instead of production, change only the script URL and use a test key:

```html
<div data-crush-key="pk_test_xxxxxxxxxxxx"></div>
<script async src="https://testbe.channelrush.net/widget/v1/channelrush.js"
        data-cookieconsent="ignore" data-ot-ignore></script>
```

The widget automatically talks to the server it was loaded from (any `*.channelrush.net` host over https), so the test snippet needs no extra configuration — swap the script URL back to `be.channelrush.net` with your `pk_live_…` key to go live. Test keys only work on the test server (and on `localhost`); bookings made there use the test card and never reach a live payment gateway. If your site sends a Content Security Policy, allowlist `https://testbe.channelrush.net` while testing (see [csp.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#content-security-policy)).

## Platform guides

- [WordPress](https://help.channelrush.com/hc/channelrush/articles/booking-widget#word-press) — Elementor, Divi, Gutenberg
- [Squarespace](https://help.channelrush.com/hc/channelrush/articles/booking-widget#squarespace)
- [Wix](https://help.channelrush.com/hc/channelrush/articles/booking-widget#wix) — read this one before embedding on Wix
- [Webflow](https://help.channelrush.com/hc/channelrush/articles/booking-widget#webflow)
- [Static HTML / any other site](https://help.channelrush.com/hc/channelrush/articles/booking-widget#static-html-custom-sites-other-cmss)

## Reference

- [csp.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#content-security-policy) — Content Security Policy directives
- [cookie-consent.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#cookie-consent-tools-cookiebot-one-trust) — Cookiebot / OneTrust
- [theming.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#theming) — every `--crush-*` variable
- [events.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#events-and-analytics) — `crush:*` events, GA4 / Google Tag Manager
- [versioning.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#versions-pinning-browser-support) — pinning, `/v1/` vs `/1.x.y/`, browser support

## From your ChannelRUSH settings

What the widget picks up from the property's own settings, with nothing to configure on your page:

- **Extras for the stay.** When the property sells add-ons (airport transfer, breakfast, parking …), the guest gets
  an extras step between the cart and the guest details, with a photo, the price and a quantity for the whole
  booking or per room — for an extra priced per person, how many of the guests take it (up to the room's guests). The
  server prices every extra — the widget never does arithmetic. A property that sells none never sees the step.
- **Closed dates in the calendar.** Days the property takes no check-in or check-out, and minimum stays, are greyed
  out in the date picker, each saying why. The widget only ever greys out a stay the booking engine would refuse
  anyway; when in doubt it leaves the day open and the search says what is available. Sold-out nights are struck
  through but can still be picked: the guest gets the results for those dates, which say which rooms are sold out.
- **Flexible dates.** When the property switches it on, "Flexible dates? See open dates" appears under
  the search form and on the room list. It opens a calendar of the days a stay can start on for the nights the guest
  chooses — with the lowest price per night on each day, taxes and fees included, if the property shows prices —
  and "See rooms" lists the rooms for the dates picked. With prices on, the date picker also shows the price under
  each check-in day. The property may also show "Only N rooms left" when few remain; ChannelRUSH leaves that off
  unless the property turns it on.

## Prices include taxes and fees

Every room price a guest sees includes the taxes and fees set up for the property in ChannelRUSH:
the total for the stay, the average per night, and a note saying "Includes taxes and fees". A promo code shows as the
amount saved. In the cart each room shows its full price too. The price summary lists the room rate, each fee and
tax, and the total, and the total is the most prominent figure. This follows the US FTC rule on fees for lodging (16 CFR 464, in force since May 2025) and the EU
and UK rules on showing the final price. If your own pages quote room prices next to the widget, include the taxes
and fees there too.

## Deep links

Any page with the widget accepts these query parameters (all optional, prefixed so they never collide with your own):

| Parameter | Meaning |
|---|---|
| `crush_ad`, `crush_dd` | Arrival and departure, `yyyy-MM-dd`. Both present: the widget opens straight on the room list for those dates. |
| `crush_na`, `crush_nc` | Adults and children (one room). |
| `crush_promo` | Promo code. |
| `crush_cur`, `crush_lang` | Currency (ISO 4217) and language, e.g. `EUR`, `de-DE`. |
| `crush_rt` | A room type: the widget books **that room only**, with a "See all rooms" link for the others. |
| `crush_rp` | A rate plan: that rate is **preselected** on every room that offers it. |
| `crush_cal` | A month, `yyyy-MM`: the widget opens on the **flexible-dates calendar** at that month (when the property has it on; otherwise the search form). With it, `crush_ad` / `crush_dd` are the stay already picked on the calendar. |
| `crush_n` | With `crush_cal`: the number of nights the calendar prices, 1–30. |

`?crush_ad=2026-09-10&crush_dd=2026-09-13&crush_na=2&crush_nc=0&crush_promo=SUMMER&crush_cur=EUR&crush_lang=de-DE`

opens the room list for those dates. `?crush_cal=2026-10&crush_n=3&crush_na=2` opens the flexible-dates calendar on
October, pricing three-night stays for two adults. `?crush_lookup=1&crush_res=HV100123` opens "Find your booking" with the reservation number filled in (this is what the confirmation email links to).

### "Book this room" and rate landing pages

A guest who clicks "Book this room" has already chosen the room, so `crush_rt` focuses the booking flow on that room. Existing `/book?crush_rt={roomTypeId}` links do not need to change, and no new booking API is needed:

- The search form names it ("Your room: Deluxe Double"). Guest selection follows the room’s capacity, counting adults and children together. If a link or saved search specifies too many guests, the widget asks the guest to correct the party size or see all rooms.
- The room list shows that room alone, with its rates. Other rooms, sold-out ones included, are not listed.
- The date picker uses this room’s restrictions. When flexible dates are enabled and the cart is empty, "See open dates" shows this room’s available stays. With calendar prices enabled, prices are for this room, not a different room at the property; they are not limited to a rate preselected with `crush_rp`.
- When the room cannot be sold for the dates, the widget shows the reason when available, such as sold out, no check-in or check-out that day, or a minimum stay. Otherwise it shows a general unavailable message.
- While choosing dates or viewing results in the full widget, "See all rooms" returns to the property’s room list and guest limits. The linked room is listed first when available for the party. Reloading while the room link remains in the address restores the room-focused view.

`crush_rp` preselects that rate on every room that offers it; a rate the room does not offer leaves that room's first rate selected. Nothing is added to the cart until the guest presses **Select**, and after that "Add another room" offers the same room again (or every room, after "See all rooms"); **Change** on a cart line of another room (one already in the cart before the link) offers every room. A room id the property does not show (unknown, or switched off) books nothing alone: the widget lists every room, without an error. While the search form or the room list is showing, both parameters stay in the address through a currency or language switch, a reload and the browser's Back button; from the cart on they leave the address. Reloading there restores the cart without a URL-only room restriction. An inline `data-crush-room-type` remains configured after a reload, including at the cart.

- A room page's button: `https://www.yourhotel.com/book?crush_rt=1234` — no dates needed: the guest picks them on the booking page. A guest who already searched in this browser tab goes straight to that room's rates for those dates, with any rooms already chosen kept.
- An ad for a rate: `https://www.yourhotel.com/book?crush_ad=2026-10-02&crush_dd=2026-10-05&crush_rp=5678`.

Use `https://be.channelrush.net/widget/v1/channelrush.js` (recommended), or pin `https://be.channelrush.net/widget/1.2.0/channelrush.js`. Version 1.2.0 supports this room-specific flow. A widget pinned to 1.1.0 or older only lists the `crush_rt` room first among the others; update the script URL to get the new behavior. If switching a pinned script with an `integrity` attribute to `/widget/v1/`, remove that attribute; if staying pinned, use the matching hash in [Versions and pinning](https://help.channelrush.com/hc/channelrush/articles/booking-widget#subresource-integrity).

### Booking on a room page

To let guests book a room without leaving its page, put the widget on the room page and name the room with `data-crush-room-type`. It works as a `crush_rt` link does, and wins over a `crush_rt` in the page's address:

```html
<div data-crush-key="pk_live_xxxxxxxxxxxx" data-crush-room-type="1234"></div>
<script async src="https://be.channelrush.net/widget/v1/channelrush.js"
        data-cookieconsent="ignore" data-ot-ignore></script>
```

The whole booking (dates, rates, extras, guest details, payment) then happens on the room page. Use one widget per page: only the first one on a page keeps its steps in the address. A room page's search bar can name the room the same way (`data-crush-mode="searchbar"` with `data-crush-room-type`): it uses the room’s combined adult-and-child capacity and sends the room to the booking page, unless `data-crush-target` names one itself.

Replace `1234` with the room's id from the [content API](https://help.channelrush.com/hc/channelrush/articles/content-api), the same id used in `crush_rt`. Room type and rate plan ids are also listed in **CRS Settings → Booking Widgets → How to use a key → Site content → Room type and rate plan ids, for room pages and booking links**. Your ChannelRUSH contact can help identify the right room.

### A search form on another page

To let guests pick dates on your home page and land on the booking page with the rooms already listed (no second click), use either:

1. **The widget's own search bar** — `data-crush-mode="searchbar"` with `data-crush-target="/book"` (see [wix.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#wix)). It has the widget's date picker and checks the dates before leaving the page. On a room page, name the room with `data-crush-room-type="1234"` (or in the target: `data-crush-target="/book?crush_rt=1234"`).
2. **Your own HTML form** — any `GET` form whose fields carry the parameter names. Style it as you like; no script is needed on that page:

```html
<form method="get" action="/book">
  <input type="date" name="crush_ad" required>
  <input type="date" name="crush_dd" required>
  <select name="crush_na"><option>1</option><option selected>2</option><option>3</option><option>4</option></select>
  <select name="crush_nc"><option selected>0</option><option>1</option><option>2</option></select>
  <input type="hidden" name="crush_rt" value="1234"> <!-- optional: on a room page -->
  <button>Check availability</button>
</form>
```

`<input type="date">` submits `yyyy-MM-dd`, which is what the widget reads. A date-picker plugin that submits another format (`10/02/2026`) is ignored — the guest then lands on the search form instead of the room list. Empty fields are ignored.

### Google Hotel Ads

A Google Hotel Ads or free booking link click can land on your widget page the same way. The landing URL Google opens looks like:

`https://www.yourhotel.com/book?crush_ad=2026-10-02&crush_dd=2026-10-05&crush_na=2&crush_nc=0`

If ChannelRUSH runs your Google Hotels connection, tell your ChannelRUSH contact the booking page's address and we set it up. If you manage your own Hotel Center point-of-sale, build the URL from Google's variables: `crush_ad=(CHECKINYEAR)-(CHECKINMONTH)-(CHECKINDAY)&crush_dd=(CHECKOUTYEAR)-(CHECKOUTMONTH)-(CHECKOUTDAY)&crush_na=(NUM-ADULTS)&crush_nc=(NUM-CHILDREN)`.

### Conversion goals

See [events.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#url-based-goals): after a booking the page address gains `crush_confirmed=1`.

## What the widget never does

- No cookies. Search criteria and the cart live in `sessionStorage` for the tab only; card data never leaves the payment form.
- No requests to anything but the `channelrush.net` host it was loaded from — `https://be.channelrush.net` for the live snippet — plus Cloudflare Turnstile for bot checks on lookup / change / cancel and after repeated payment failures.
- No changes to your page's styles or globals beyond `window.ChannelRUSH`.

---

## WordPress

Works with any theme and page builder. Paste the snippet where the booking form should appear. Add `data-cookieconsent="ignore"` / `data-ot-ignore` to the script tag if you run Cookiebot or OneTrust ([cookie-consent.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#cookie-consent-tools-cookiebot-one-trust)).

```html
<div data-crush-key="pk_live_xxxxxxxxxxxx" data-crush-lang="en-US" data-crush-currency="USD"></div>
<script async src="https://be.channelrush.net/widget/v1/channelrush.js" data-cookieconsent="ignore" data-ot-ignore></script>
```

### Elementor

1. Edit the page with Elementor, drag an **HTML** widget (Basic → HTML) into the section.
2. Paste the snippet into the HTML Code box. Save.
3. Set the section/column width as you like; the widget adapts to its container (it lays out in one column under 640 px, two above, three above 960 px).

Editor mode: the widget deliberately renders **nothing** inside the Elementor editor iframe (it checks `elementorFrontend.isEditMode()`), so the HTML widget looks empty while editing. Preview or view the page to see it.

Elementor popups and lazy-loaded sections are fine: the script watches the page for ten seconds after load and mounts into any `data-crush-key` element that appears.

### Divi

1. Add a **Code** module (not Text) where you want the widget.
2. Paste the snippet into the module's Content field. Divi keeps `<script>` tags in Code modules.
3. Divi's Visual Builder does run scripts; if you see the widget inside the builder that is expected. If the Code module shows the snippet as text, switch the module's content editor to the code view (the `</>` tab).

Divi's global resets (`* { box-sizing }`, uppercase headings, button resets) do not reach the widget: it renders in Shadow DOM. The widget uses a system font stack by default; set `style="--crush-font: …"` on the `<div>` to match your Divi font.

### Gutenberg (block editor)

1. Add a **Custom HTML** block.
2. Paste the snippet.
3. Use the block's **Preview** tab to see it; the editor's edit view shows the raw HTML.

If your user role cannot save `<script>` tags (the `unfiltered_html` capability, common on WordPress.com and multisite), ask an administrator to paste it, or add the script tag once via a header/footer plugin (e.g. "WPCode" → Footer) and keep only the `<div>` in the block. One script tag serves every widget `<div>` on the page.

### Caching / optimisation plugins

- Do **not** let WP Rocket, Autoptimize, LiteSpeed Cache or similar combine, defer-rewrite or "delay" the widget script. Add `be.channelrush.net` to the plugin's exclusion list. Delaying it until user interaction breaks the deep links from confirmation emails.
- Do not self-host or minify the script; it is already minified and versioned. See [versioning.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#versions-pinning-browser-support) if you want to pin a version.

### Checklist

- Page shows "Find a room" with the calendar and a Search button.
- Choosing dates and searching lists rooms with prices in the right currency.
- The browser console shows no `[ChannelRUSH]` errors. A message about the key or the domain means the key is not bound to this site's domain in ChannelRUSH.

---

## Squarespace

**Requires a Business plan or higher** — Personal plans cannot run custom code (`<script>`) in Code Blocks or Code Injection.

### Code Block (recommended)

1. Edit the page, add a **Code** block where the booking form should appear.
2. Set the block to **HTML** (not Markdown) and paste:

```html
<div data-crush-key="pk_live_xxxxxxxxxxxx" data-crush-lang="en-US" data-crush-currency="USD"></div>
<script async src="https://be.channelrush.net/widget/v1/channelrush.js" data-cookieconsent="ignore" data-ot-ignore></script>
```

3. Save. In the editor the block may render a placeholder; open the live page to check.

### Code Injection (site-wide script)

Settings → Advanced → Code Injection → **Footer**:

```html
<script async src="https://be.channelrush.net/widget/v1/channelrush.js" data-cookieconsent="ignore" data-ot-ignore></script>
```

then place only the `<div data-crush-key="…"></div>` in a Code Block on the booking page. Use this when you have several booking pages, or when Code Blocks strip scripts on your template.

### AJAX page loading

Many Squarespace templates (Brine family and others) load pages with AJAX, so a script in a Code Block does not re-run when the visitor navigates to the booking page from another page. Two options:

- Turn off **Enable AJAX Loading** (Design → Site Styles → search "AJAX"); or
- keep AJAX on and load the script via Code Injection (Footer). The widget watches the page for new `data-crush-key` elements for ten seconds after each load and mounts into them; with AJAX navigation the footer script is already on the page, so the `<div>` from the Code Block is picked up as it is inserted.

If the widget appears on a hard refresh but not after in-site navigation, AJAX loading is the cause.

### Squarespace-specific notes

- Squarespace's global styles do not reach the widget (Shadow DOM), and the widget uses a system font stack by default. Set `style="--crush-font: …"` on the `<div>` to match your site's font ([theming.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#theming)).
- Squarespace serves your site over HTTPS; the widget requires that.
- Cookie banner: Squarespace's own banner does not block scripts. If you added Cookiebot or OneTrust, see [cookie-consent.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#cookie-consent-tools-cookiebot-one-trust).

---

## Wix

Wix does not let you add a `<script>` to the page itself. Its "Embed HTML" element (Add → Embed code → Embed HTML) renders your code inside a **sandboxed iframe** on a `wixsite.com` / `filesusr.com` origin. That has consequences for a booking flow:

- The iframe has a fixed height that you set in the Wix editor; content that grows past it scrolls inside the frame.
- The page URL and browser history belong to the Wix page, not to the iframe: no deep links into the booking flow, no Back button through the steps.
- `sessionStorage` inside the frame is separate from the page's; a visitor who leaves and comes back starts over.
- Your key must be bound to the iframe's origin (`*.wixsite.com` / `*.filesusr.com` shown in the browser's network tab), not only to your custom domain.

The widget detects the Wix frame and switches to its **compact layout** automatically (internal scrolling, no URL writes). It works, but the experience is better with the recommended setup below.

### Recommended: search bar on Wix, booking on your own page

1. Host the full widget on a page you control — a plain HTML page on your own domain, a subdomain (`book.yourhotel.com`), or any non-Wix host — using the standard snippet ([static-html.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#static-html-custom-sites-other-cmss)).
2. On the Wix site, add an **Embed HTML** element with the widget in **searchbar mode**. Submitting the search sends the visitor to your booking page with the dates, guests, promo code, currency and language in the URL:

```html
<div data-crush-key="pk_live_xxxxxxxxxxxx"
     data-crush-mode="searchbar"
     data-crush-target="https://book.yourhotel.com/"
     data-crush-currency="EUR" data-crush-lang="de-DE"></div>
<script async src="https://be.channelrush.net/widget/v1/channelrush.js"></script>
```

The redirect navigates the **top** window (the visitor leaves the Wix page for the booking page; the frame is not stuck inside). Without `data-crush-target` the widget logs a warning and renders the full flow instead.

Set the Embed HTML element to about **160 px high, full width** for the search bar.

### Full widget inside the Wix frame

If you must run the whole flow inside Wix:

1. Add → Embed code → **Embed HTML**, paste the standard snippet.
2. Size the element to the full page width and **900 px high**; the widget scrolls internally when a step is taller (compact layout).
3. Bind the key to the Wix iframe origin in ChannelRUSH (open the page, check the network tab for the frame's host).
4. Accept the limitations above (no deep links, no browser Back between steps, no restore after leaving the page).

Wix Velo (custom code with `$w`) and the "Custom element" option do not change any of this: both still isolate third-party HTML in a frame.

### Wix ADI / Wix Studio

Same element ("Embed HTML" / "Embed a widget"), same behaviour.

---

## Webflow

Custom code needs a paid **Site plan** (Basic or higher) or a paid Workspace when exporting.

### Embed element

1. Open the page in the Designer, drag an **Embed** element (Add → Advanced → Embed) where the booking form should appear.
2. Paste the snippet:

```html
<div data-crush-key="pk_live_xxxxxxxxxxxx" data-crush-lang="en-US" data-crush-currency="USD"></div>
<script async src="https://be.channelrush.net/widget/v1/channelrush.js" data-cookieconsent="ignore" data-ot-ignore></script>
```

3. Publish. The Designer canvas shows a placeholder for Embed elements; the widget renders only on the published site.

### Page or site settings (script once, `<div>` anywhere)

Page settings → Custom code → **Before `</body>` tag**, or Project settings → Custom code → Footer code:

```html
<script async src="https://be.channelrush.net/widget/v1/channelrush.js" data-cookieconsent="ignore" data-ot-ignore></script>
```

Then use an Embed element containing only the `<div>`.

### Notes

- Webflow's class-based styles do not reach the widget (Shadow DOM). The widget uses a system font stack by default; match your site's font with `--crush-font` ([theming.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#theming)).
- The Embed element's size is the widget's container: the widget uses container queries, so a narrow column gets the one-column layout regardless of the viewport.
- Webflow's page transitions/interactions do not interfere; if you use a third-party "smooth page transition" script that swaps `<body>` content, the widget mounts again automatically for ten seconds after each load, and you can call `ChannelRUSH.init({ key, el })` after the swap for longer-lived apps.

---

## Static HTML, custom sites, other CMSs

Any page that can contain a `<div>` and a `<script>` can host the widget.

```html
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>Book your stay</title>
</head>
<body>
  <main style="max-width: 1100px; margin: 0 auto; padding: 24px;">
    <div data-crush-key="pk_live_xxxxxxxxxxxx"
         data-crush-lang="en-US"
         data-crush-currency="USD"
         data-crush-fallback-url="https://reservation.services/yourhotel"
         style="--crush-primary:#1e3a5f; --crush-radius:8px;"></div>
  </main>
  <script async src="https://be.channelrush.net/widget/v1/channelrush.js"
          data-cookieconsent="ignore" data-ot-ignore></script>
</body>
</html>
```

- The script can go anywhere (`<head>` with `async`, or the end of `<body>`); it mounts into every `data-crush-key` element present at `DOMContentLoaded` and keeps watching for ten seconds.
- One script serves any number of widgets on a page (for example two properties). Only the first widget on a page writes deep-link parameters to the URL; the others run in memory.
- Serve the page over **HTTPS**. Plain-http pages can call the HTTPS API, but sessionStorage restore and Turnstile behave better on HTTPS and some browsers warn about card forms on http pages.
- Register the exact origin(s) of the page with the key: `https://www.yourhotel.com` and `https://yourhotel.com` are two origins. Sub-paths do not matter.

### Programmatic use (single-page apps, React, Vue, …)

```js
const instance = ChannelRUSH.init({ key: 'pk_live_…', el: document.getElementById('book'), language: 'de-DE', currency: 'EUR' });
// later, when the component unmounts:
instance.destroy();   // or ChannelRUSH.destroy(el)
```

`init` is idempotent per element. Everything the widget adds to the page (Shadow DOM, event listeners, the `data-crush-mounted` marker) is removed by `destroy()`.

An ES module build is available at `https://be.channelrush.net/widget/v1/channelrush.esm.js` (`import { init, destroy, version } from …`); it does not define the global and does not auto-mount. Like the script build, it talks to the `channelrush.net` host it was imported from — import it from `testbe.channelrush.net` to target the test server.

### Also see

[csp.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#content-security-policy) if your server sends a Content-Security-Policy header, [events.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#events-and-analytics) for analytics, [theming.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#theming) for colours and sizing.

---

## Theming

The widget is styled entirely through CSS custom properties read from its host `<div>`. Set any subset inline, in your stylesheet, or through `ChannelRUSH.init({ theme: { primary: '#0d47a1' } })` (keys without the `--crush-` prefix are prefixed for you). Values the property configured in ChannelRUSH are applied first; whatever you set on the page wins.

```html
<div data-crush-key="pk_live_…"
     style="--crush-primary:#1e3a5f; --crush-primary-contrast:#fff; --crush-radius:8px; --crush-font:'Inter', system-ui, sans-serif;"></div>
```

```css
/* or in a stylesheet */
[data-crush-key] { --crush-primary: #1e3a5f; --crush-accent: #b8860b; }
```

### Variables

All twenty variables, with their defaults (from the widget's base stylesheet):

| Variable | Default | Used for |
|---|---|---|
| `--crush-font` | system stack (`system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif`) | Font family of everything in the widget. The widget cannot inherit your page font through its style isolation, so set this to your site's font stack to match it. |
| `--crush-font-size` | `16px` | Base font size; every other size is relative to it (`em`). |
| `--crush-color-text` | `#1f2328` | Body text. |
| `--crush-color-muted` | `#6b7280` | Secondary text: hints, descriptions, per-night prices, "Includes taxes and fees", weekday names, policy line. |
| `--crush-color-bg` | `transparent` | Background of the whole widget area. |
| `--crush-color-surface` | `#ffffff` | Cards (search form, room cards, cart lines, summary, banners), inputs and secondary buttons. |
| `--crush-color-border` | `#d0d7de` | Borders of cards, inputs, buttons, amenity chips, summary rows. |
| `--crush-primary` | `#0d47a1` | Primary buttons (Search, Select, Continue, Pay), selected calendar days, selected rate plan border, checkbox/radio accent, link buttons. |
| `--crush-primary-contrast` | `#ffffff` | Text on primary buttons and selected days. |
| `--crush-accent` | `#0d47a1` | Prices and the reservation number. |
| `--crush-danger` | `#b42318` | Error text and borders, sold-out lines, the required-field asterisk, cancelled status. |
| `--crush-success` | `#067647` | "Only n left", applied promo code, a promo's "Save …" line, confirmed status, cancellation-done banner. |
| `--crush-radius` | `6px` | Corner radius of cards, inputs, buttons, calendar cells, images. |
| `--crush-shadow` | `0 1px 2px rgba(0, 0, 0, 0.08)` | Card shadow. |
| `--crush-gap` | `12px` | Spacing unit: grid gaps, card padding, margins (fractions/multiples derived). |
| `--crush-input-height` | `44px` | Minimum height of text inputs and selects. |
| `--crush-button-height` | `44px` | Minimum height of buttons (keep ≥ 44px for touch targets). |
| `--crush-max-width` | `none` | Maximum width of the widget; the layout follows its container otherwise. |
| `--crush-image-ratio` | `4 / 3` | Aspect ratio of room photos. |
| `--crush-focus-ring` | `0 0 0 3px rgba(13, 71, 161, 0.35)` | Focus indicator (box-shadow) on every focusable control; match it to `--crush-primary`. |

### Layout

The widget uses container queries, not media queries: it becomes two-column above a **640 px** container and three-column (room cards) above **960 px**. Put it in a narrow sidebar and it stays single-column even on a wide screen. There are no fixed heights; images use the aspect ratio above.

### Dark backgrounds

There is no automatic dark mode. For a dark page set the surface/text/border trio, e.g.

```css
[data-crush-key] {
  --crush-color-bg: transparent;
  --crush-color-surface: #1b1f24;
  --crush-color-text: #e6edf3;
  --crush-color-muted: #9da7b3;
  --crush-color-border: #30363d;
  --crush-primary: #4c8dff;
  --crush-primary-contrast: #0b0f14;
  --crush-focus-ring: 0 0 0 3px rgba(76, 141, 255, 0.45);
}
```

Keep text/surface contrast at 4.5:1 or better; the defaults meet WCAG AA.

### What you cannot restyle

Everything inside the widget lives in Shadow DOM: your selectors (`.btn`, `h2`, `input`, …) do not reach it, and its rules do not leak out. Only the variables above cross the boundary; typography is re-established inside the widget, so set `--crush-font` (and `--crush-font-size`) to match your site. Reduced-motion preferences are respected automatically.

---

## Events and analytics

The widget dispatches DOM `CustomEvent`s on its host `<div>` (they bubble and cross the shadow boundary, so `document.addEventListener` works). Each `detail` is built from a fixed allow-list — never guest names, emails, card data or addresses. The same events reach `ChannelRUSH.init({ onEvent(name, detail) })`.

A hosted ChannelRUSH booking site reports the same events with the same names and fields, and pushes them to `dataLayer` for you: see [Analytics events on your hosted booking site](https://help.channelrush.com/hc/channelrush/articles/booking-widget#analytics-events-on-your-hosted-booking-site).

| Event | `detail` | When |
|---|---|---|
| `crush:search` | `{ arrival, departure, adults, children, promoCode }` | a search is submitted (dates are `yyyy-MM-dd` strings) |
| `crush:add_room` | `{ roomTypeId, ratePlanId, arrival, departure, adults, children }` | a room is added to the cart |
| `crush:remove_room` | `{ roomTypeId, ratePlanId, lineId }` | a cart line is removed (also when a sold-out line is dismissed) |
| `crush:quote` | `{ total, currency, rooms }` | the server priced the cart (fires again on every cart change, extra chosen, currency or language switch) |
| `crush:checkout_start` | `{ rooms, nights, currency }` | the guest reaches guest details — from the cart, or from the extras step when the property sells extras. It does not fire again when the guest goes back and forward |
| `crush:booking_confirmed` | `{ reservationId, rooms, nights, currency, total }` | the booking is confirmed |
| `crush:booking_canceled` | `{ reservationId }` | a booking is cancelled through "Find your booking" |
| `crush:booking_modified` | `{ reservationId }` | a booking's dates or guests are changed through "Find your booking" |

Extras have no event of their own: choosing one re-prices the cart, so it arrives as a `crush:quote` with the new total.

`crush:booking_modified` carries the reservation number only — no amounts: a change can charge or refund a difference, and the booking's new total is not an e-commerce event of its own. `total` is the booking total in `currency` (number). `reservationId` is the property's reservation number as printed on the confirmation.

### Plain JavaScript

```html
<script>
  document.addEventListener('crush:booking_confirmed', function (e) {
    console.log('booked', e.detail.reservationId, e.detail.total, e.detail.currency);
  });
</script>
```

### Google Analytics 4 (gtag.js)

```html
<script>
  document.addEventListener('crush:search', function (e) {
    gtag('event', 'search', { search_term: e.detail.arrival + '..' + e.detail.departure, adults: e.detail.adults, children: e.detail.children });
  });
  document.addEventListener('crush:add_room', function (e) {
    gtag('event', 'add_to_cart', { items: [{ item_id: e.detail.roomTypeId, item_variant: e.detail.ratePlanId, quantity: 1 }] });
  });
  document.addEventListener('crush:checkout_start', function (e) {
    gtag('event', 'begin_checkout', { currency: e.detail.currency });
  });
  document.addEventListener('crush:booking_confirmed', function (e) {
    gtag('event', 'purchase', {
      transaction_id: e.detail.reservationId,
      value: e.detail.total,
      currency: e.detail.currency,
      items: [{ item_name: 'Hotel stay', quantity: e.detail.rooms }]
    });
  });
  document.addEventListener('crush:booking_canceled', function (e) {
    gtag('event', 'refund', { transaction_id: e.detail.reservationId });
  });
</script>
```

### Google Tag Manager

Add a **Custom HTML** tag, trigger **All Pages** (or the booking page only), that forwards the widget events into the data layer:

```html
<script>
  (function () {
    var map = {
      'crush:search': 'crush_search',
      'crush:add_room': 'add_to_cart',
      'crush:remove_room': 'remove_from_cart',
      'crush:quote': 'crush_quote',
      'crush:checkout_start': 'begin_checkout',
      'crush:booking_confirmed': 'purchase',
      'crush:booking_canceled': 'refund',
      'crush:booking_modified': 'crush_booking_modified'
    };
    Object.keys(map).forEach(function (name) {
      document.addEventListener(name, function (e) {
        var d = e.detail || {};
        var payload = { event: map[name] };
        if (name === 'crush:booking_confirmed') {
          payload.ecommerce = {
            transaction_id: d.reservationId,
            value: d.total,
            currency: d.currency,
            items: [{ item_name: 'Hotel stay', quantity: d.rooms }]
          };
        } else if (name === 'crush:booking_canceled') {
          payload.ecommerce = { transaction_id: d.reservationId };
        } else {
          payload.crush = d;
        }
        window.dataLayer = window.dataLayer || [];
        window.dataLayer.push({ ecommerce: null });
        window.dataLayer.push(payload);
      });
    });
  })();
</script>
```

Then create a GA4 Event tag for `purchase` with a Custom Event trigger on event name `purchase`, reading `ecommerce.transaction_id`, `ecommerce.value`, `ecommerce.currency` and `ecommerce.items` from Data Layer Variables (or use the "Send Ecommerce data" option with Data Layer as the source).

### URL-based goals

Prefer the `crush:booking_confirmed` event above: it fires once per booking and carries the reservation number and total. For tools that can only match a page address (a "destination" goal, a URL-based conversion), the widget also marks the address when a booking is confirmed:

`https://www.yourhotel.com/book?crush_confirmed=1`

The widget changes the address in place (`history.replaceState`) — the page does not reload — so the tool must watch address changes on the page:

- **Google Tag Manager**: a **History Change** trigger with the condition *Page URL contains `crush_confirmed=1`*.
- **Google Analytics 4**: enhanced measurement → Page views → *Page changes based on browser history events* (on by default), then mark the `page_view` whose `page_location` contains `crush_confirmed=1` as a key event.
- A tool that only counts full page loads will not see it; use the event instead.

The marker carries nothing else: no reservation number, no amount, no guest details. It is already in the address when `crush:booking_confirmed` fires, so a GTM trigger may also combine the two (event `purchase` *and* Page URL contains `crush_confirmed=1`).

| Situation | Address | Counts again? |
|---|---|---|
| Booking confirmed | `…?crush_confirmed=1` (replaces the payment step's entry) | — |
| Guest presses **Book another stay**, or opens **Manage this booking** | that address is replaced — one address change, the marker gone from history | no |
| Guest presses Back from the confirmation | the guest-details entry, no marker | no |
| Guest reloads the confirmation page | the page loads once with the marker, then the widget shows the search form and removes it | **yes, for a URL goal** — like any thank-you page reload; `crush:booking_confirmed` does not fire again |
| Back, then Forward to the confirmation | the marker appears for a moment, then the search form replaces it | possibly, for a history-change trigger |

It is not written inside a Wix embed (compact layout), in search-bar mode, or by a second widget on the same page — those never change the page address.

### Notes

- Events fire once per action; `crush:quote` is the only one that repeats (every re-price).
- If your consent tool gates GA, the listeners above simply forward into a `dataLayer`/`gtag` that is not sending; the widget itself is unaffected.
- The confirmation email deep link (`?crush_lookup=1&crush_res=…`) opens the lookup step directly; no event fires until the guest acts.

---

## Cookie consent tools (Cookiebot, OneTrust, …)

The widget sets **no cookies** and uses `sessionStorage` only for the visitor's current search and cart (cleared when the tab closes). It needs no consent category. Consent tools that auto-block unknown `<script>` tags will, however, block it until the visitor accepts "marketing" or "statistics" — which stops guests from booking.

Mark the script tag as exempt:

```html
<script async src="https://be.channelrush.net/widget/v1/channelrush.js"
        data-cookieconsent="ignore"
        data-ot-ignore></script>
```

| Tool | Attribute | Notes |
|---|---|---|
| **Cookiebot** | `data-cookieconsent="ignore"` | With "Auto blocking mode" on, every script without this attribute is held until consent. If you use manual blocking instead, leave `type="text/javascript"` (do not set `type="text/plain"`). |
| **OneTrust** | `data-ot-ignore` | Required when "Auto-Block" is enabled in the OneTrust script settings. Alternatively classify `be.channelrush.net` as "Strictly necessary" in the OneTrust categorisation. |
| **Usercentrics** | `data-usercentrics="…"` not needed | Usercentrics only blocks scripts you explicitly configure; do not add the widget to its Smart Data Protector list. |
| **Complianz / CookieYes / WordPress plugins** | — | These block by rewriting `type` on scripts you list; do not list the widget. |
| **Consent Mode (Google)** | — | Not applicable; the widget does not use Google tags. Your GTM/gtag forwarding of `crush:*` events ([events.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#events-and-analytics)) follows your own consent state. |

Also exempt `https://challenges.cloudflare.com` (Cloudflare Turnstile, the bot check on the "Find your booking" step) if your tool blocks by domain: Turnstile does not set marketing cookies either.

### How to tell the widget was blocked

The page shows an empty gap where the widget should be, and the browser console shows the widget script with `type="text/plain"` or the consent tool's log entry. If the script ran but the API was blocked, the widget renders a panel that names the likely cause (see [csp.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#content-security-policy)).

---

## Content Security Policy

If your site sends a `Content-Security-Policy` header (or meta tag), allow the following. Nothing else is contacted.

```
script-src   'self' https://be.channelrush.net https://challenges.cloudflare.com;
connect-src  'self' https://be.channelrush.net;
img-src      'self' https://be.channelrush.net https://cr-production.appspot.com;
frame-src    https://challenges.cloudflare.com;
```

| Directive | Why |
|---|---|
| `script-src https://be.channelrush.net` | the widget script itself (`/widget/v1/channelrush.js`) |
| `script-src https://challenges.cloudflare.com` | Cloudflare Turnstile (bot check). Loaded only when needed: the "Find your booking" / cancel steps, and after repeated payment failures. |
| `connect-src https://be.channelrush.net` | all API calls (`/v1/config`, `/v1/search`, `/v1/quote`, `/v1/book`, `/v1/bookings/…`) and the on-demand language files (`/widget/v1/i18n/de.json`) |
| `img-src https://cr-production.appspot.com https://be.channelrush.net` | room and property photos (CDN) |
| `frame-src https://challenges.cloudflare.com` | the Turnstile challenge renders in an iframe |

`style-src`: **nothing is required.** The widget applies its stylesheet through `adoptedStyleSheets` (a CSSOM API, not governed by `style-src`) in every browser it supports. On engines without `adoptedStyleSheets` it falls back to a `<style>` element inside its shadow root and copies the `nonce` from its own `<script nonce="…">` tag, so a nonce-based `style-src` still passes. It never sets `style=""` attributes; theme values are CSS custom properties that **you** set on the `<div>` (your inline style, your policy — put them in a stylesheet rule instead if your policy forbids inline styles).

**Testing against the test server**: while your embed loads the script from `https://testbe.channelrush.net`, use that host in `script-src`, `connect-src`, and `img-src` in place of (or alongside) `https://be.channelrush.net` — the widget talks to the host it was loaded from.

`form-action`: not needed (the widget submits with `fetch`, never a form navigation). `font-src`: not needed (it inherits your font or uses the system stack).

No `'unsafe-eval'`, no `'unsafe-inline'` is required by the widget. The programmatic `ChannelRUSH.init(...)` inline snippet is **your** inline script and needs your nonce or hash like any other; the declarative `data-crush-key` form needs none.

### Nonce-based policies

```html
<script nonce="r4nd0m" async src="https://be.channelrush.net/widget/v1/channelrush.js"></script>
```

The widget reuses that nonce for the two things it may add later: the Turnstile `<script>` tag and the fallback `<style>`.

### Diagnosing a blocked widget

- **Blank space, nothing rendered, console shows "Refused to load the script"**: `script-src` is missing `https://be.channelrush.net`, or a consent tool blocked the tag ([cookie-consent.md](https://help.channelrush.com/hc/channelrush/articles/booking-widget#cookie-consent-tools-cookiebot-one-trust)). The widget cannot help here — its code never ran.
- **Panel "The booking widget is blocked by this site's Content Security Policy"**: the script ran, but the browser reported a `securitypolicyviolation` for `be.channelrush.net` when it tried to fetch its configuration. Add `connect-src`.
- **Panel "We can't reach the booking service right now … Site owner: …"** with a Retry button: the configuration request failed without a CSP report. Usually `connect-src` on a browser that does not fire violation events for fetch, an ad/privacy blocker, or a real outage. The panel links to your `data-crush-fallback-url` when set.
- **"Verification is unavailable" on Find your booking**: Turnstile could not load — check `script-src`/`frame-src` for `challenges.cloudflare.com`.

### Report-only first

Deploy with `Content-Security-Policy-Report-Only` and watch the reports for `be.channelrush.net` / `challenges.cloudflare.com` before enforcing.

---

## Versions, pinning, browser support

### Two URLs

| URL | Behaviour | Cache |
|---|---|---|
| `https://be.channelrush.net/widget/v1/channelrush.js` | **Rolling**: always the latest 1.x release. Recommended. | 1 hour, stale-while-revalidate 1 day |
| `https://be.channelrush.net/widget/1.2.0/channelrush.js` | **Pinned**: this exact release; it does not update automatically. | 1 year, immutable |

The content components (`channelrush-content.js`, see the [content API guide](https://help.channelrush.com/hc/channelrush/articles/content-api))
ship in the same folders from 1.1.0, under the same rules: `…/widget/v1/channelrush-content.js` rolls,
`…/widget/1.2.0/channelrush-content.js` is pinned.

The rolling `v1/` URL receives bug fixes and new features that keep the embed contract (attributes, `ChannelRUSH.init` options, event names and `detail` shapes, theme variables, minimum browser) unchanged. Anything that would break that contract ships as `2.0.0` under `/widget/v2/`, alongside `v1/`, and **`v1/` keeps receiving fixes for 12 months** after `v2` is released. Check that a pinned script and its `version.json` are available before using that version.

Each folder also contains `channelrush.esm.js` (ES module build; `channelrush-content.esm.js` likewise), source maps, `version.json` (`{ "version": "1.2.0", "integrity": "sha384-…", "contentIntegrity": "sha384-…" }` — useful when reporting a problem) and `i18n/*.json` (language files loaded on demand from the same folder).

### Subresource Integrity

SRI hashes are published **for pinned URLs only** (the table below lists the `integrity` value per version; it is also in each folder's `version.json`). The rolling `v1/` file changes with every release, so an `integrity` attribute on it would break your embed at the next release — do not add one there.

```html
<script src="https://be.channelrush.net/widget/1.2.0/channelrush.js"
        integrity="sha384-ZirSvgOu1ahVEzKF7dfMX0GpJPGUz6RUeuXDplr+z8j1baJWRJ/jIeRLc8lJHHba"
        crossorigin="anonymous" async></script>
```

| Version | Released | `integrity` of `channelrush.js` (pinned URL only) | `integrity` of `channelrush-content.js` |
|---|---|---|---|
| 1.2.0 | Available; verified 2026-10-29 | `sha384-ZirSvgOu1ahVEzKF7dfMX0GpJPGUz6RUeuXDplr+z8j1baJWRJ/jIeRLc8lJHHba` | `sha384-XTkxLMVjMec53EW2lfpztFp5T8/O/lY9pbfUvoksd32URDdysnGwRi1rQmz2/08C` |
| 1.0.1 | 2026-10-11 | `sha384-ZZxOZPY/737e0PbE38yF802aG1qQBFCqDDm5jFGtsW6GjqrpaqcKWmnWe53GWsxd` | — |
| 1.0.0 | 2026-10-10 | `sha384-x0SZ31kqGHnHzbRkTC8SG1jAjnWf9IZTiGPjqUoAV+d5EL7E5BrIJog2hAZkYddc` | — |

1.0.0 is the first release. 1.0.1: an extra priced per person is chosen by the number of guests who take it (up to the
room's guests), not a quantity charged for every guest. 1.1.0 adds the content components (`channelrush-content.js`);
the booking widget works as in 1.0.1. 1.2.0: a "Book this room" link (`crush_rt`) books that room only — its rates,
its guest limit, its own open dates, and "See all rooms" for the others — where 1.1.0 listed it first among them; and
`data-crush-room-type` books one room on the room's own page (see
[booking on a room page](https://help.channelrush.com/hc/channelrush/articles/booking-widget#booking-on-a-room-page)).

If you pin, put a reminder in your calendar: a pinned widget does not get security fixes automatically.

### Wire contract

Widget 1.x always talks to API `/v1/`. API changes that the widget needs are additive within `/v1/`; a widget major bump may move to a new API version, never the reverse.

### Browser support (v1)

Requires ES2020, Shadow DOM, `adoptedStyleSheets` (or the built-in `<style>` fallback) and CSS container queries — in practice:

- Safari 16 and later (macOS and iOS)
- Chrome / Edge 105 and later
- Firefox 110 and later
- Samsung Internet 20 and later

Older browsers do not get a broken layout: the widget shows "Your browser is too old to run the booking widget" with a link to your `data-crush-fallback-url` (the hosted booking page) or, without one, a "please book by phone" line.

### Reporting a problem

Include the page URL, the value from `…/widget/v1/version.json` (or `ChannelRUSH.version` in the console), the browser, and any `[ChannelRUSH]` console lines. Every API error carries a request id in the network response (`requestId`); quoting it lets support find the server-side log entry.

---

## Analytics events on your hosted booking site

Your hosted ChannelRUSH booking site reports each step of a booking, so your tag manager or analytics can measure
searches, carts, checkouts and bookings. They are the same events, with the same names and fields, as the
[embeddable booking widget](https://help.channelrush.com/hc/channelrush/articles/booking-widget#events-and-analytics) — one setup covers both.

Every event is sent two ways, from the page itself (`document`):

1. a DOM `CustomEvent` named `crush:…` that `document.addEventListener` (or `window.addEventListener`) can hear;
2. a push to `window.dataLayer`, already in the GA4 e-commerce shape — no forwarding tag is needed.

This works on every template, including the ones that draw the booking engine in an isolated part of the page
(a shadow root): scripts in **Page Header** cannot look inside the engine, but they do hear these events.

The payloads are built from a fixed allow-list. They never contain a guest's name, e-mail, phone, address or any
card data.

### Events

| DOM event | `dataLayer` event | When | Fields |
|---|---|---|---|
| `crush:search` | `crush_search` | A results page is shown for dates the guest asked for | `arrival`, `departure` (`yyyy-MM-dd`), `adults`, `children` |
| `crush:add_room` | `add_to_cart` | A room and rate plan were added to the cart | `roomTypeId`, `ratePlanId`, `arrival`, `departure`, `adults`, `children` |
| `crush:remove_room` | `remove_from_cart` | A room was removed from the cart | `roomTypeId`, `ratePlanId` |
| `crush:quote` | `crush_quote` | The cart or the checkout page shows the priced cart (repeats on every view) | `total`, `currency`, `rooms` |
| `crush:checkout_start` | `begin_checkout` | The guest opens the checkout page | `rooms`, `nights`, `currency` |
| `crush:booking_confirmed` | `purchase` | A booking was made | `reservationId`, `rooms`, `nights`, `currency`, `total` |
| `crush:booking_canceled` | `refund` | The guest canceled a booking | `reservationId` |
| `crush:booking_modified` | `crush_booking_modified` | The guest changed a booking | `reservationId` |

`total` is the booking total including taxes and fees, as a number, in `currency`. `reservationId` is the
reservation number printed on the confirmation. A changed booking carries no amounts: a change can charge or refund
a difference, so it is not a sale of its own.

#### What lands in `dataLayer`

```js
// purchase (each e-commerce push is preceded by { ecommerce: null })
{ event: 'purchase',
  ecommerce: { transaction_id: 'R-10482', value: 480.5, currency: 'USD',
               items: [{ item_name: 'Hotel stay', quantity: 1 }] } }

// refund
{ event: 'refund', ecommerce: { transaction_id: 'R-10482' } }

// everything else
{ event: 'add_to_cart', crush: { roomTypeId: '7', ratePlanId: '10', arrival: '2026-10-01', … } }
```

In Google Tag Manager, create a GA4 Event tag per event you want, with a **Custom Event** trigger on the event name
(`purchase`, `begin_checkout`, …). For `purchase`, read `ecommerce.*` from Data Layer Variables or use "Send
Ecommerce data" with the Data Layer as the source.

Without a tag manager:

```html
<script>
document.addEventListener('crush:booking_confirmed', function (e) {
  gtag('event', 'purchase', {
    transaction_id: e.detail.reservationId, value: e.detail.total, currency: e.detail.currency
  });
});
</script>
```

Put either in **Page Header** (CRS admin → Content).

### Good to know

- **Booking, change and cancel events fire once.** Reloading the confirmation page does not repeat them. If the
  guest's first answer was lost and the booking is confirmed on a retry, `purchase` may be reported for the same
  `transaction_id` again; GA4 de-duplicates on it.
- `crush:search` fires when a results page is shown (a reload repeats it), `crush:quote` on every view of the cart
  or checkout. Use them for funnels, not for counting unique actions.
- Differences from the widget: there is no `promoCode` on `crush:search` (the code is entered at checkout) and no
  `lineId` on `crush:remove_room`.
- Looking up a booking fires nothing until the guest changes or cancels it.
- If your consent tool blocks analytics, the events still fire; your tags decide what is sent.
