Embed Orar on a business website

Install

  1. Deploy the updated frontend to your Orar hosting domain. The frontend build includes /embed.js and /embed-guide.html; no new backend or database deployment is needed for embedding.
  2. In Orar, open Settings → Add to your website.
  3. Copy the installation code into a Custom HTML block on the business's website. Use a block that permits JavaScript, not a text/code-display block.
  4. Publish the host page, check it on mobile, and make a test booking. Real booking forms create real appointments; use a test business when testing.

Example (replace the entire booking URL and script origin with the code from Settings):

<div data-orar-url="https://YOUR-ORAR-DOMAIN/book/TENANT/SLUG">
  <a href="https://YOUR-ORAR-DOMAIN/book/TENANT/SLUG" target="_blank" rel="noopener">Open booking page</a>
</div>
<script src="https://YOUR-ORAR-DOMAIN/embed.js" defer></script>

Use the deployed HTTPS Orar address on a live website. Localhost addresses only work on the developer's computer. Orar and the business website can have different domains. The website owner does not need API keys, Firebase configuration, or an Orar login for visitors.

The script creates a titled iframe and resizes it as the form changes, including shrinking after confirmation. Each widget is independent. Load the script once when possible; repeat inclusion does not create duplicate frames. Keep the fallback link for browsers, extensions, or website builders that block the widget. The host container must have a usable width; avoid setting a fixed height or overflow:hidden on it.

The layout preview in Settings is a live form in a fixed-height preview frame. Automatic resizing happens on the installed host page.

Successful-booking events

Register this listener on the host website before visitors can submit a booking:

<script>
  document.addEventListener('orar:booking-success', function (event) {
    const { bookingId, status } = event.detail;
    // Connect to your own analytics only when permitted by your consent settings.
    // Do not count both pending and later approval as two new bookings.
    console.log('Orar booking submitted:', bookingId, status);
  });
</script>

The event bubbles from the div[data-orar-url] containing the widget. For multiple widgets, attach the listener to a specific container or inspect event.target.

Field Meaning
bookingId Opaque appointment reference, useful for deduplicating conversions
status: "confirmed" The appointment was confirmed immediately
status: "pending" The request was accepted but still needs staff approval

An event is emitted after successful server confirmation, not when a visitor clicks a button, holds a time, encounters an error, or opens the page. Repeated success messages for the same booking are deduplicated within each widget's lifetime. Your analytics should also deduplicate by booking reference if needed. No name, email, phone, answers, payment data, or reservation token is included. A booking reference is still an identifier; apply your own retention and consent policies.

For Google Tag Manager, a site developer can adapt this example inside the site's consent-approved analytics setup:

document.addEventListener('orar:booking-success', function (event) {
  window.dataLayer = window.dataLayer || [];
  window.dataLayer.push({
    event: event.detail.status === 'confirmed' ? 'orar_booking_confirmed' : 'orar_booking_requested',
    orar_booking_id: event.detail.bookingId,
    orar_booking_status: event.detail.status
  });
});

This only publishes a data-layer event. Configure the corresponding analytics/ad conversion tag and consent checks yourself. Orar does not install ad pixels, read campaign cookies, collect UTMs, or guarantee delivery to analytics. Staff approvals after the visitor leaves do not generate browser events. This client-side signal is for UI/analytics, not a trusted payment or fulfillment webhook.

Website builders and dynamically rendered pages

For script-restricted sites, link to the booking page or use a plain iframe with a manual height. A plain iframe does not provide the host-side resizing or custom events described above.

Troubleshooting and security

Scope

Included: inline embedding, copyable installation code and layout preview, automatic height updates, fallback link, and successful-booking events. Not included: popup widgets, campaign attribution, custom styling controls, per-business allowed domains, ad-platform configuration, or server webhooks.