The Carepatron Online booking widget makes it easy for potential new clients to find your availability and book an appointment online. To do this:
Navigate to the Calendar page
Select the Booking Link button in the upper-right corner
Click the Format Link dropdown
Select Button or Inline embed
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 through the Help channel in your workspace.