Put the booking calendar on your website
Summary
Section titled “Summary”The KonversAI booking calendar shows your open days and times on your own web page. A customer picks a day or a time, and KonversAI opens a booking chat on the same page. You copy the code from the Embed on your website section on the calendar page in the KonversAI console, and paste the code into your page HTML. The code shows the one calendar you copied it from, in the language you choose. You can tick other calendars to show some of your calendars on the page and hide the rest.
Who can do this
Section titled “Who can do this”In the KonversAI console, you need calendar access to open the calendar page. To pick the chat entry point for the booking chat, you also need tenant settings access. If you do not see Booking or Settings in the left sidebar, ask a tenant administrator to change your role.
On your website, you need a person who can edit the HTML, or who can paste a script into your content management system.
Before you start
Section titled “Before you start”Make sure your tenant has the calendar feature. Calendar is a per-tenant feature flag. When the feature is off, Calendar is missing under Booking in the left sidebar of the KonversAI console. A tenant administrator can switch it on under Cost & contract > Addons.
Create and save the booking calendar first. The Embed on your website section appears only on a saved calendar. Read Set up a booking calendar for those steps.
Create a chat entry point at Settings > Entry-points, on the Chat tab. The booking chat that opens after a customer picks a time belongs to that entry point. Read Install the widget on your website for those steps.
- Select Booking in the left sidebar of the KonversAI console, select Calendar, then select Settings.
- Go to Your calendars and select Edit on the calendar you want on the page. The Edit calendar page opens.
- Go to Embed on your website. You find the section at the bottom of the page, and in the list of sections beside the form.
- Choose a Chat entry point when your tenant has more than one. The booking chat opens with that entry point. With one entry point, KonversAI uses that entry point and shows no choice.
- Choose a Language. Page language (automatic) follows the language the customer’s browser prefers. Choose Norwegian, Swedish, Danish, German or English to fix the language instead.
- To show other calendars on the same page, tick them under Also show these calendars. Tick none to show this calendar alone. The section is missing when you have only one calendar.
- Select Copy code. The button changes to Copied.
- Paste the code into your page HTML where you want the booking calendar to appear.
- Publish the page, then open the page in a browser. The booking calendar shows the next five weeks for this calendar, with no calendar picker. When you ticked other calendars, the booking calendar shows a picker of the calendars you ticked and this calendar.
The code has this shape. The KonversAI console fills in the real values, so copy the code from Embed on your website instead of typing the code by hand.
<script src="https://your-chat-service.example.com/static/widget/calendar.js" data-tenant="your-company" data-tenant-key="YOUR_REFERENCE_KEY" data-api-base="https://your-chat-service.example.com" data-calendar="YOUR_CALENDAR_ID" data-locale="nb"></script>data-calendar locks the booking calendar to this calendar. data-locale
sets the language. The code has no data-locale when you choose Page
language (automatic).
When you tick other calendars under Also show these calendars, the code
lists the ID of each calendar in data-calendar, separated by commas, for
example data-calendar="ID_ONE,ID_TWO". The booking calendar then shows a
picker with All calendars and the name of each calendar in the list, and
hides your other calendars.
To place the booking calendar inside an element somewhere else on the page,
add data-target with a CSS selector, for example data-target="#booking".
Without data-target, the booking calendar appears right after the script tag.
Why does the booking calendar list all my calendars in a dropdown?
Section titled “Why does the booking calendar list all my calendars in a dropdown?”The script tag on your page has no data-calendar attribute. Without
data-calendar, a tenant with more than one calendar gets a picker with All
calendars and the name of each calendar. To show one calendar only, copy the
code again from that calendar. In the KonversAI console, select Booking,
then Calendar, then Settings, then Edit on the calendar. Go to
Embed on your website and select Copy code. The new code has data-calendar, so
the booking calendar hides the picker. Customers on that page cannot see or
choose your other calendars. To show some of your calendars and not all of
them, tick the other calendars under Also show these calendars before you
copy the code.
How do I show only some of my calendars?
Section titled “How do I show only some of my calendars?”Tick the calendars you want under Embed on your website, then copy the code again. Follow these steps in the KonversAI console and on your website:
- In the KonversAI console, select Booking, select Calendar, then select Settings.
- Go to Your calendars and select Edit on one of the calendars you want on the page. The Edit calendar page opens.
- Go to Embed on your website. Under Also show these calendars, tick each other calendar you want on the page.
- Select Copy code. The code has each calendar ID in
data-calendar, separated by commas. - Paste the code into your page HTML, in place of any booking calendar code already on the page.
- Publish the page, then open the page in a browser.
The booking calendar shows a picker with All calendars and the name of each calendar in your list. All calendars means the calendars in your list, not every calendar your tenant has. Customers on that page cannot see or choose the calendars you left out. When a customer picks a day with All calendars selected, the booking chat offers only the calendars in your list.
To change code that is already on your page, you can edit data-calendar by
hand. Put the ID of each calendar in the attribute, separated by commas, for
example data-calendar="ID_ONE,ID_TWO". Copy each ID from the data-calendar
value in the code of that calendar under Embed on your website.
What happens when one of the calendars in my list is not available?
Section titled “What happens when one of the calendars in my list is not available?”The booking calendar skips a calendar in data-calendar that does not take
bookings. A calendar does not take bookings when the calendar was deleted, or
when the calendar card says Season ended because the Closes on date is
in the past. When only one calendar in your list still takes bookings, the
booking calendar shows that calendar and hides the picker. When none of the
calendars in your list takes bookings, the page says “This calendar is not
available.” The browser developer console shows [Calendar Widget] data-calendar does not match an available calendar: followed by each ID that did not match.
The page says “This calendar is not available.” What is wrong?
Section titled “The page says “This calendar is not available.” What is wrong?”The data-calendar value on your page does not match a calendar that takes
bookings. When data-calendar lists several IDs, none of them matches. Check
three things. First, copy the code again from Embed on your
website on the calendar page, at Booking > Calendar > Settings >
Edit, and replace the code on your page. Second, make sure the calendar
still exists in Your calendars. Third, check that the calendar card does
not say Season ended. A calendar whose Closes on date is in the past is
not available. The browser developer console also shows [Calendar Widget] data-calendar does not match an available calendar: followed by the ID the
page used.
The page says “We’re not taking new bookings here at the moment.” Why?
Section titled “The page says “We’re not taking new bookings here at the moment.” Why?”The booking calendar embed is not taking bookings, because every booking
continues in a chat and that chat is off. Check two things. First, open
Settings > Entry-points > Chat in the KonversAI console, and find the
chat entry point whose key is in the data-widget-key attribute of your
calendar embed code. Check Chat is on on that entry point, then select
Save. See Turn the chat off on your website.
Second, when Chat is on is already checked, your plan or contract does not
allow conversations at the moment, and the console shows a banner to your team.
See Manage your plan and invoicing.
How do I show the booking calendar in Norwegian, Swedish or Danish?
Section titled “How do I show the booking calendar in Norwegian, Swedish or Danish?”Choose the Language under Embed on your website on the calendar page,
then select Copy code. The code then has a data-locale attribute: nb
for Norwegian, sv for Swedish, da for Danish, de for German or en for
English. The buttons, headings, messages, weekday names, month names and dates
use that language. On a site with one page for each language, paste code with
a different Language on each page. You can also change data-locale in
code you already pasted. no and region forms such as nb-NO also work.
Which language does Page language (automatic) use?
Section titled “Which language does Page language (automatic) use?”Page language (automatic) under Embed on your website leaves
data-locale out of the code. The booking calendar then tries three sources in
this order. First, the languages the customer’s browser prefers, best match
first. Second, the Default language of your tenant, at Settings > AI
preferences in the KonversAI console. Last, English. The lang attribute of
the <html> tag on your page does not set the language. To fix the language
for a page, choose a Language instead. The booking calendar
skips any source in a language it does not support. It supports English,
Norwegian, Swedish, Danish and German.
Why is the calendar name still in English?
Section titled “Why is the calendar name still in English?”The booking calendar shows the calendar name exactly as you typed it in Name under Basics on the calendar page. KonversAI does not translate calendar names. Give each calendar a name in the language of the page that shows it. Select Booking, then Calendar, then Settings, then Edit on the calendar to change Name, then select Save calendar.
Which language does the booking chat use?
Section titled “Which language does the booking chat use?”When the page has no chat widget of its own, the booking calendar opens the
booking chat with the same data-locale value. Without data-locale, the
booking chat follows the language the customer’s browser prefers. When the page already has the KonversAI chat widget snippet, the
booking chat opens in that chat widget, with that snippet’s settings. Add the
same data-locale attribute to the chat widget snippet to set its language.
Why does the code say YOUR_REFERENCE_KEY?
Section titled “Why does the code say YOUR_REFERENCE_KEY?”KonversAI could not fill in the key of a chat entry point. Either your role has
no tenant settings access, or your tenant has no chat entry point yet. Ask a
tenant administrator to copy the code from Embed on your website on the
calendar page instead. Or replace YOUR_REFERENCE_KEY with the
data-tenant-key value from Embed code on a chat entry point at
Settings > Entry-points, on the Chat tab. The booking chat does not
open until the key is correct.
Nothing appears where I pasted the code. What do I check?
Section titled “Nothing appears where I pasted the code. What do I check?”Open the browser developer console. The warning [Calendar Widget] data-tenant and data-widget-key are required. means the script tag is missing
data-tenant or data-tenant-key. Copy the code again from Embed on your
website on the calendar page and paste the whole code. The text “Could not
load calendar.” in the booking calendar means the browser could not reach
KonversAI. Check that your page loads the src address in the code, and that
your Content Security Policy allows that address.
Last reviewed . Tell us when a step no longer matches the product.