Integrations
Connect Google Calendar
Connect a Google Calendar to an assistant so its busy times block bookings and every booking, reschedule and cancellation is written to your calendar.
When a customer books with your assistant, Aiva Chat saves the appointment in its own appointment book and writes it to the assistant's Google Calendar. Reschedules and cancellations move or delete the event there too. Before offering a time, Aiva Chat also checks the calendar's busy times, so your own meetings and events block those times. The connection uses a Google Cloud service account: a robot Google account that Aiva Chat signs in as, with permission to edit one calendar. You connect a calendar per assistant, and each assistant writes to one calendar. You need a Google account with access to Google Cloud, the calendar you want to use, and an assistant that can book appointments.
How the connection works (read this first)
Every channel (phone calls, the website widget's voice and text chat, booking pages, your Aiva Chat website and the dashboard) follows the same booking rules:
- A time is only offered if it's inside your opening hours, doesn't clash with an appointment already in Aiva Chat, and isn't busy in the connected Google Calendar. Events you add straight into that calendar block those times on every channel.
- If Google Calendar can't be read at that moment, Aiva Chat refuses the booking rather than risk a double booking.
- Every booking, reschedule and cancellation is saved in Aiva Chat's appointment book and written to the assistant's Google Calendar.
A calendar is optional. Without one, every channel (phone calls, the widget's voice and text chat, booking by text and booking pages) books into Aiva Chat's own appointment book, using your opening hours and the appointments already there. Connect Google Calendar if you also keep appointments or meetings there, so those times aren't offered.
1. Create a service account in Google Cloud
Do this in Google Cloud. Google's screens change from time to time, so follow Google's own guides for the exact clicks:
- Create (or pick) a Google Cloud project and enable the Google Calendar API for it.
- Create a service account in that project (Google's guide).
- Create a key for the service account in JSON format and download it (Google's guide).
Open the JSON file in a text editor. You need two values from it:
client_email: the service account's email address.private_key: the long block that starts with-----BEGIN PRIVATE KEY-----and ends with-----END PRIVATE KEY-----.
Keep this file private. Anyone who has it can edit the calendars you share with the service account.
2. Share your calendar with the service account
- In Google Calendar, open Settings and sharing for the calendar you want bookings to go into.
- Share it with the service account's email (
client_email) and give it the Make changes to events permission (Google's guide to sharing a calendar). - In the same settings, under Integrate calendar, find the Calendar ID and copy it. For your main calendar, it's usually your Gmail address. For other calendars, it's a longer address ending in
@group.calendar.google.com.
A separate calendar just for Aiva Chat bookings is a good idea. It keeps AI bookings easy to spot.
3. Add the credentials to your assistant
- In the sidebar, under AI Configuration, open Assistants, then click the assistant.
- On the General tab, scroll to Google Calendar. Until it's connected, it says Not connected.
- Click Add credentials.
- Fill in:
- Calendar ID: the ID you copied in step 2.
- Service account email: the
client_emailvalue. - Private key: paste the whole
private_keyvalue, including the BEGIN and END lines.
- Click Save draft.
If you're using the full-page Create Assistant form instead, the same details go under Function Configuration: choose Google Calendar Booking in Select Function, then fill in Google Calendar ID, Google Client Email and Google Private Key.
The section now shows Saved. The private key is never shown again once saved. To change the credentials, click Replace. Leave a field blank to keep its current value. To disconnect, click Remove. The assistant then stops booking until you add new credentials, and the change takes effect when you save.
4. Make sure booking is switched on
Open the assistant's Actions tab and check that the booking actions are on, such as Checking calendar availability and Booking the appointment, plus rescheduling and cancelling if you want them. The Receptionist, Support and Follow-up agent types start with booking switched off, so turn it on here if you need it.
Then test it: book an appointment on a test call, and check that it appears on the Appointments page and in your Google Calendar.
Add bookings made outside Aiva Chat
You can add them straight into the connected Google Calendar, and Aiva Chat will treat those times as busy. Or add them in Aiva Chat:
- In the sidebar, under Campaigns & Scheduling, open Appointments.
- Click New appointment.
- Fill in Customer name, Phone, the service, Date and Time, and choose which assistant it's Handled by. Add Notes if you like.
- Click Book appointment.
The booking goes into Aiva Chat's appointment book, so the assistant won't offer that time, and it's written to that assistant's Google Calendar like any other booking. For more on services, hours and booking rules, see Set up bookings.
Troubleshooting
Bookings show in Aiva Chat but not in Google Calendar. Check that the calendar is shared with the exact service account email and that the service account can make changes to events. Check that the Calendar ID is correct. If needed, click Replace and paste the private key again, including the BEGIN and END lines.
The assistant booked over a meeting in my calendar. Check the meeting is in the exact calendar connected to that assistant (the Calendar ID), and that it's marked as busy, not free, in Google Calendar. Events in other calendars aren't checked.
Customers are told no times are available. If Google Calendar can't be read (for example, the key was removed in Google Cloud or the calendar was unshared), Aiva Chat refuses bookings rather than risk a double booking. Check the sharing and credentials above.
I have two assistants. Each one has its own Google Calendar section on its General tab, so add the credentials to each assistant that books appointments.
Next steps
Something here doesn’t match what you see in the dashboard? Email support@aivachat.io and we’ll fix the guide.