> ## Documentation Index
> Fetch the complete documentation index at: https://docs.datalyr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Calendly

> Receive Calendly bookings, cancellations, no-shows, and routing form leads, and send booked calls to your ad platforms.

When you finish, every Calendly booking arrives in **Events** as `call_booked`, linked to the ad click that started it.

## What Calendly sends

DATALYR creates an organization webhook in Calendly. It subscribes to four Calendly events.

| Calendly event | Condition | DATALYR event | Money role |
| - | - | - | - |
| `invitee.created` | A new booking | `call_booked` | None |
| `invitee.created` | Replaces an earlier booking (a reschedule) | `call_rescheduled` | None |
| `invitee.canceled` | A cancellation | `call_cancelled` | None |
| `invitee.canceled` | The old half of a reschedule | Nothing | None |
| `invitee_no_show.created` | | `call_no_show` | None |
| `routing_form_submission.created` | An answer holds an email address | `lead_submitted` | None |

A reschedule writes one `call_rescheduled` and no `call_cancelled`. A routing form without an email answer writes nothing.

The event ID is `calendly_` plus the invitee or submission ID and the stage, so a redelivered webhook is a duplicate. No Calendly event carries a value.

## Before you start

| Requirement | Detail |
| - | - |
| DATALYR access | Owner or admin of the workspace |
| Calendly plan | Standard or above |
| Calendly role | Owner or admin of the Calendly organization. The token must come from that user |
| Web tracking | The [tracking script](/getting-started/install-web-tracking) on every page that embeds or links to your booking page |

## Connect Calendly

<Steps>
  <Step title="Create a personal access token">
    In Calendly, open **Integrations & apps → API & webhooks**. Create a personal access token.
  </Step>

  <Step title="Grant the scopes">
    Grant `users:read`, `scheduled_events:read`, `routing_forms:read`, `webhooks:read`, and `webhooks:write`.
  </Step>

  <Step title="Open the Calendly card">
    In DATALYR, open **Sources**. On the **Calendly** card, select **connect**.
  </Step>

  <Step title="Paste the token">
    Paste the token into **Personal access token**. Select **Connect Calendly**.
  </Step>

  <Step title="Install tracking">
    Add the tracking script to the `<head>` of every page that embeds or links to your booking page.
  </Step>
</Steps>

DATALYR creates the webhook for your whole Calendly organization and signs it with its own key. The connected card shows the organization ID.

## How bookings match to ad clicks

DATALYR checks these in order and stops at the first one that finds an ad click.

| Order | Source | Comes from |
| - | - | - |
| 1 | `salesforce_uuid` | A DATALYR `visitor_id` passed on the booking URL |
| 2 | Invitee email | The invitee email, matched to an earlier visit or `identify()` call |
| 3 | UTMs | `utm_source`, `utm_medium`, `utm_campaign`, `utm_content`, and `utm_term` on the booking or embed URL |

To pass the `visitor_id`, add it as `salesforce_uuid` when you build the embed. Place this code below the tracking script.

```html theme={null}
<div id="calendly-embed" style="min-width:320px;height:700px;"></div>
<script src="https://assets.calendly.com/assets/external/widget.js"></script>
<script>
  var vid = window.datalyr && window.datalyr.getVisitorId ? window.datalyr.getVisitorId() : '';
  Calendly.initInlineWidget({
    url: 'https://calendly.com/YOUR_LINK?salesforce_uuid=' + encodeURIComponent(vid),
    parentElement: document.getElementById('calendly-embed')
  });
</script>
```

DATALYR uses `salesforce_uuid` only when it holds a DATALYR `visitor_id` (`anon_` plus a UUID). Any other value is ignored.

With no match, `visitor_id` is `calendly_` plus the Calendly invitee ID.

## Set up conversion rules

Select the flag icon on the connected **Calendly** card to open the starter rules.

| Event | Meta | TikTok | Value |
| - | - | - | - |
| `call_booked` | `Schedule` | `SubmitForm` | Set a fixed value: what a booked call is worth to you |

A booking arrives within minutes of the click, inside the 7-day window Meta and TikTok optimize on.

Google Ads has no starter rules for Calendly. Create a rule by hand in **Conversions** and pick your conversion action.

## Verify

1. Open a page that embeds your booking page in a private window. Add `?utm_source=doctest` to the URL.
2. Book a test slot with a test email address.
3. Open **Events**. Confirm a `call_booked` row with source `calendly`.
4. Expand the row. Confirm `event_data.email` and the UTM values.
5. Cancel the booking in Calendly. Confirm a `call_cancelled` row arrives.

## When it does not work

| Symptom | Cause | Check | Fix |
| - | - | - | - |
| **Connect Calendly** shows `That token was rejected by Calendly` | The token is wrong or revoked | The token in **Integrations & apps → API & webhooks** | Create a new token. Paste it again |
| Connect shows `Calendly refused the webhook` | The plan is below Standard, or the token's user is not an organization owner or admin | Your Calendly plan and role | Upgrade to Standard. Create the token as an owner or admin |
| No Calendly events | The DATALYR webhook was removed in Calendly | The connected **Calendly** card | Disconnect and connect again |
| No UTMs on `call_booked` | The booking or embed URL carries no UTM parameters | The embed URL | Pass the page's UTM parameters to the embed URL |
| `visitor_id` starts with `calendly_` | No `salesforce_uuid`, no known email, no UTMs | The embed URL | Pass `salesforce_uuid` as shown above |
| No `lead_submitted` rows | The routing form has no email question | The routing form in Calendly | Add an email question |

## Next

* [Commas](/integrations/commas): record the cash from the calls you book.
* [Lead generation](/use-cases/lead-generation): choose the stage to optimize toward.
* [Conversion delivery](/advanced/conversion-delivery): how a rule resolves value and identity.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.