Skip to main content
All CollectionsAppointment Scheduling & Calendar
Embed an online booking link on your website
Embed an online booking link on your website

How do I embed a booking link on my website?

Updated over a week ago

The Carepatron Online booking widget makes it easy for potential new clients to find your availability and book an appointment online. To do this:

  1. Navigate to the Calendar page

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

  3. Click the Format Link dropdown

  4. Select Button or Inline embed

  5. 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 fire analytics events or change the state of your app.

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);
}
});

Our team will be able to answer any other questions you may have. Just reply via messenger or reach out to team@carepatron.com.

Did this answer your question?