Website embeds and links

Put online booking or a contact form on your own website, or link straight to a practitioner, place or booking type.

In the examples, replace values in capitals, such as YOUR_ORG and YOUR_API_TOKEN, with your own.

Embed booking on your website #

Add the booking flow to any page with an iframe and one script:

<iframe
    src="https://YOUR_ORG.kaddio.com/iframe/booking/cal"
    style="width: 100%; border: 0"
    title="Book an appointment"
></iframe>
<script src="https://YOUR_ORG.kaddio.com/iframe-resizer.js" defer></script>

The script makes the iframe grow with its content, so visitors never see two scrollbars. Include it once per page, even if the page has several Kaddio iframes.

If your website has a sticky header, add its height in pixels to the iframe, so the booking flow never scrolls in under it:

<iframe src="https://YOUR_ORG.kaddio.com/iframe/booking/cal" data-kaddio-offset="80" …></iframe>

Link to https://YOUR_ORG.kaddio.com/booking/cal to open the full booking page. Use the same paths after /iframe/booking/cal in an embed.

Choose what to book #

Add up to four path segments to pick a practitioner, place, booking type or company customer, in any order:

https://YOUR_ORG.kaddio.com/booking/cal/PRACTITIONER/BOOKING_TYPE/PLACE

Each segment is the slug from the item's Direct link in Kaddio:

  • Practitioner: the practitioner's profile, under Calendar and booking
  • Booking type and place: the booking settings for each booking type and place
  • Company customer: the customer's profile, under Booking

The visitor can then only book what the link points to. Add selectonly=true to preselect the choices but let the visitor change them.

Query parameters #

Parameter What it does
firstname, lastname, email, cellphone Prefill the visitor's details in the booking form
bookingref Your own reference, stored with the booking. See Partner booking
redirect-url A page on your site that visitors can be sent to after booking
selectonly Let the visitor change the preselected practitioner, place or booking type

For example:

https://YOUR_ORG.kaddio.com/booking/cal?firstname=Erik&lastname=Svensson&email=erik%40example.com&redirect-url=https%3A%2F%2Fexample.com%2Fthanks

Encode parameter values with encodeURIComponent or similar.

Embed the contact form #

The contact form can be embedded the same way:

<iframe
    src="https://YOUR_ORG.kaddio.com/iframe/contact-us"
    style="width: 100%; border: 0"
    title="Contact us"
></iframe>
<script src="https://YOUR_ORG.kaddio.com/iframe-resizer.js" defer></script>

Booking and the contact form both need to be turned on for the organization in Kaddio.

Events from the embed #

An embedded booking flow or contact form sends messages to your page with postMessage, so you can track conversions in your own analytics:

Message When
kaddio.contactForm.success The contact form has been sent
kaddio.CATEGORY.ACTION A step in the booking flow, such as a completed booking. Sent only when the organization has a Google Analytics ID in Kaddio

Only accept messages from your Kaddio address:

window.addEventListener('message', (event) => {
    if (event.origin !== 'https://YOUR_ORG.kaddio.com') return;

    if (event.data === 'kaddio.contactForm.success') {
        // for example, send a conversion event to your analytics
    }
});

Messages are sent only when the Kaddio page is embedded directly in your page, not in a nested iframe.

Questions? Ask the help assistant here on the site, or ask Kaddio AI inside Kaddio. You can also contact support.