Skip to main content

Embed an online booking link on your website

How do I embed a booking link on my website?

Updated over 2 weeks ago

Embedding an online booking link on your website makes it easy for clients to schedule appointments anytime, without contacting you directly. This helps streamline your workflow, increase bookings, and give clients a smooth, convenient way to access your services.

Here's how to do it:

  1. Navigate to the Calendar page.

  2. Select the Booking Link button in the upper-right corner.

  3. Select Button or Inline embed.

  4. Click the Copy button.


Notifying the parent window and listening to events

The embedded scheduling page notifies the parent window of important events during the booking flow. As a developer, you can subscribe to these notifications to trigger analytics events or update your app's state.

We use window.postMessage() to post events to the parent window. The event payload is a JavaScript object of the following format, where XXX is the name of the booking flow event:

{ event: 'carepatron.XXX' }

Here are the events Carepatron fires when an invitee follows the booking flow:

Event name

Event description

carepatron.date_and_time_selected

Invitee selected date and time

carepatron.completed

Invitee successfully booked a meeting

Looking for more events? Reach out to our team.

This example code listens to these events and logs them to the console:

// Javascript
function isCarepatronEvent(e) {
return e.origin
&& e.origin.endsWith('carepatron.com')
&& e.data.event
&& e.data.event.indexOf("carepatron.") === 0;
};

window.addEventListener("message", function(e) {
if(isCarepatronEvent(e)) {
/* Example to get the name of the event */
console.log("Event name:", e.data.event);
/* Example to get the payload of the event */
console.log("Event details:", e.data.payload);
}
});

Important:
There are limitations with event tracking when the booking app is embedded in an iFrame. Because this setup exists outside the Carepatron domain, we’re unable to provide troubleshooting support for this workaround, as diagnosing and resolving issues in this context is very limited on our end.

Our team will be able to answer any other questions you may have. Just reply via messenger through the Help channel in your workspace.

Did this answer your question?