=== BookingsXP – Better Microsoft Bookings widget ===
Contributors: bookingsxp
Tags: microsoft bookings, booking, appointments, scheduling, conversion tracking
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed your Microsoft Bookings page as a faster, better-looking booking widget with GA4, Google Ads, Meta and LinkedIn conversion tracking.

== Description ==

The standard Microsoft Bookings page is hard to fit into a website: it is a full-page app, it does not match your brand, and bookings made inside it are invisible to your analytics and ad platforms.

BookingsXP puts your Microsoft Bookings availability into a clean, responsive widget that sits inside your page, and reports every step of the booking to the tools you already use.

**Three ways to show it**

* **Inline** – the widget embedded in a page, resizing to fit its content.
* **Popup button** – a button that opens the widget in an accessible dialog.
* **Floating button** – a "Book" button in the bottom-right corner of every page.

**Two ways to set it up**

* **Link only, no account** – paste your public Microsoft Bookings link. You get the free templates and all host-page events.
* **Saved widget, free account** – create a widget at bookingsxp.com to pick templates and colours, add tracking IDs, and see booking analytics in the dashboard.

**Conversion tracking without extra code**

* Pushes `bookingsxp.*` events (for example `bookingsxp.booking_completed`) to the Google Tag Manager `dataLayer`.
* Sends GA4 events (`generate_lead` on a completed booking), Google Ads conversions (with enhanced conversions when enabled), Meta Pixel `Schedule` and LinkedIn Insight conversions when those tags are on your site and configured on your widget.
* Keeps the original campaign (UTM parameters and ad click IDs) of the visit, so bookings are credited to the ad or email that brought the visitor.
* Optional redirect to a thank-you page after booking, with `{booking_id}`, `{service}` and `{start}` placeholders.

**Built for WordPress**

* A block ("BookingsXP booking widget") with settings in the sidebar.
* A `[bookingsxp]` shortcode for classic editor, widgets and page builders.
* Settings → BookingsXP for a default widget and a site-wide floating button.
* The script (about 8 KB gzipped) loads asynchronously and only on pages that show a widget, unless you switch on "Load on every page". Inline widgets load when they scroll into view.

BookingsXP is an independent product. It is not made by, affiliated with, endorsed or sponsored by Microsoft.

== Installation ==

1. Install the plugin from Plugins → Add New, or upload the `bookingsxp` folder to `/wp-content/plugins/`.
2. Activate it.
3. Add the "BookingsXP booking widget" block to a page, or add a shortcode:
   `[bookingsxp url="https://outlook.office.com/book/YourBusiness@contoso.com/"]`
   or, with a free BookingsXP account:
   `[bookingsxp widget="w_8fk2m1qz"]`
4. Optional: set a default widget and the floating button under Settings → BookingsXP.

**Shortcode options**

* `widget` – your BookingsXP widget ID (`w_…`).
* `url` – your public Microsoft Bookings page URL (used when no widget ID is given).
* `mode` – `inline` (default), `popup` or `floating`.
* `button_text` – label of the popup / floating button (default "Book a time").
* `template` – `classic`, `compact`, `minimal`, `split`, `week`, `stepper` or `cards`.
* `theme` – `light`, `dark` or `auto`.
* `accent` – button and highlight colour, for example `#0f766e`.
* `service` – preselect a service by ID or by the code from your Bookings link (`/s/<code>`).
* `redirect_url` – page to open after a booking; supports `{booking_id}`, `{service}` and `{start}`.
* `height` – initial height in pixels before the widget sizes itself.

Example: `[bookingsxp widget="w_8fk2m1qz" mode="popup" button_text="Book a call" accent="#0f766e"]`

== Frequently Asked Questions ==

= Is this made by Microsoft? =

No. BookingsXP is an independent product that works with the public booking pages of Microsoft Bookings. It is not made by, affiliated with, endorsed or sponsored by Microsoft. Microsoft and Microsoft Bookings are trademarks of Microsoft Corporation.

= Do I need an account? =

No, not for link-only mode: paste your Microsoft Bookings link into the block or shortcode and it works, with the free templates and a small "Powered by BookingsXP" badge. A free BookingsXP account adds saved widgets, more templates, tracking IDs managed in one place, and booking analytics in the dashboard.

= Do bookings still go into Microsoft Bookings? =

Yes. BookingsXP books through your Microsoft Bookings page, so appointments appear in Microsoft Bookings as they do today.

= Which analytics and ad platforms are supported? =

Google Tag Manager (`dataLayer`), Google Analytics 4, Google Ads (including enhanced conversions), Meta Pixel and LinkedIn Insight Tag. The plugin does not add those tags to your site; it sends events to them when they are already installed.

= How do I track bookings in Google Tag Manager? =

Create a Custom Event trigger for `bookingsxp.booking_completed`. Booking details are available in the `bookingsxp` data layer variable.

= What about privacy and consent? =

The widget runs on bookingsxp.com inside an iframe. Campaign attribution (UTM parameters and ad click IDs) is kept in your visitor's browser for up to 90 days and is shared only with the widget, never placed in URLs. If the browser sends Global Privacy Control, or your consent tool sets `window.bxpConsent = false`, only the current page address and the referring site are shared and nothing is stored.

= Can I self-host the script? =

Yes. Set "Script base URL" under Settings → BookingsXP to the server that serves `/embed/v1.js` and the widget pages.

= Does it work with caching and page builders? =

Yes. The widget is plain HTML (`<bookingsxp-widget>`) plus one asynchronous script, so page caches and optimisation plugins do not need special settings. Use the shortcode in page builders that do not support blocks.

== External services ==

This plugin connects to BookingsXP (https://bookingsxp.com), an external service, to display the booking widget.

* On pages that show a widget (or on every page if you enable "Load on every page"), the visitor's browser loads the script `https://bookingsxp.com/embed/v1.js` and an iframe from `https://bookingsxp.com/embed/…`.
* The iframe receives your widget ID or Microsoft Bookings URL and the widget options you set. When the visitor books, the details they enter (name, email, phone, notes, chosen time) are sent to BookingsXP and on to your Microsoft Bookings calendar.
* Unless the visitor has Global Privacy Control enabled or your site sets `window.bxpConsent = false`, the script also shares the page address, the referring page, UTM parameters, ad click IDs and the first-party `_ga`, `_fbp` and `_fbc` cookie values with the widget, so bookings can be attributed to campaigns.

BookingsXP terms of service: https://bookingsxp.com/legal/terms
BookingsXP privacy policy: https://bookingsxp.com/legal/privacy

== Screenshots ==

1. An inline booking widget on a page.
2. The popup dialog opened from a "Book a call" button.
3. The block settings in the editor sidebar.
4. Settings → BookingsXP.

== Changelog ==

= 1.0.0 =
* First release: block, shortcode, popup and floating buttons, settings page, conversion tracking.

== Upgrade Notice ==

= 1.0.0 =
First release.
