Docs
Calendly and Cal.com
Connect Calendly or Cal.com: a demo booked by someone a partner sent makes them that partner’s lead, so the sale that follows pays the partner.
When a visitor who came through a partner’s link books a call on your Calendly or Cal.com page, Affiligato makes the person who booked a referral of that partner, by the email they booked with. A payment for that email later pays the partner: one your billing provider reports, one you record by hand, or a won deal in HubSpot or Attio.
Bookings only come in. Affiligato writes nothing to Calendly or Cal.com except the webhook it creates when you connect.
How the booking carries the partner
The tracking script adds the visitor’s click to the booking links and embeds on your site:
| Platform | What the script adds |
|---|---|
| Calendly | utm_content=<click id> |
| Cal.com | metadata[affiligato]=<click id> |
- It changes links to
calendly.comandcal.comwhen the visitor clicks them, and Calendly inline embeds (data-url) and booking iframes that are on the page when it loads. - It adds the click only when the visitor holds a partner’s referral. With
data-affiligato-consent="wait", nothing is added until your banner callsconsent(). - A link that already has
utm_content(Calendly) ormetadata[affiligato](Cal.com) is left as it is. - An embed your page creates later from JavaScript, such as a popup opened by Calendly’s widget script, is not changed. Add the click to its URL yourself: the
aff_refcookie holdsCODE.CLICK, and the click is the part after the dot.
Connect
Connect in the dashboard, so the token goes from Calendly or Cal.com to Affiligato and never passes through an AI agent. An agent can call get_integrations to see whether either is connected. Put the tracking script on the pages that link to or embed your booking page.
Calendly
Create a personal access token in Calendly
Open Integrations & apps → API and webhooks → Personal access tokens and create a token with these scopes: webhooks read and write, users read, and organizations read. Use the token of an owner or admin of your Calendly organization.
Paste it into Affiligato
Open Settings → Connect → Calendly, paste the token into Personal access token and choose Connect Calendly.
Affiligato reads your Calendly organization and subscribes it to invitee.created, for the whole organization, with a signing key it makes. It keeps the token and the key encrypted. If Calendly refuses the token, the panel says Calendly refused this access token. If Calendly does not take the subscription, it says so and asks for the token of an owner or admin.
Cal.com
Create an API key in Cal.com
Open Settings → Developer → API keys and create a new key.
Paste it into Affiligato
Open Settings → Connect → Cal.com, paste the key into API key and choose Connect Cal.com.
Affiligato creates a BOOKING_CREATED webhook in Cal.com with a secret it makes, and keeps the key and the secret encrypted. If Cal.com refuses the key, the panel says Cal.com refused this API key.
What a booking does
- Affiligato refuses a delivery whose signature does not match.
- When the booking carries a click of your program, made within your cookie window, the person who booked becomes the referral of that click’s partner: the invitee’s email on Calendly, the first attendee’s email on Cal.com.
- A booking with no click, a click of another program, or a click older than your cookie window makes nothing.
- The same booking delivered twice makes one referral.
- A canceled booking leaves the referral in place.
The referral is then a lead like any other: it stays the partner’s for your lead lifetime until a payment arrives.
When the connection breaks
Affiligato checks the token or key when you connect, and shows a refusal on the panel there. It does not check the connection after that. If the subscription or webhook is deleted in Calendly or Cal.com, bookings stop reaching Affiligato and the panel still says connected. To make a new one, choose Disconnect, then connect again.
Disconnect
Disconnect on the panel removes the Calendly subscription or the Cal.com webhook, when the token still works, and forgets the token. Delete the token or key on the platform too.