Which of the two setups you need
What this integration can and can’t track
Before you start
You’ll need:- A live Referly program with at least one affiliate to test with. See setting up your program if you haven’t got that far.
- A Cal.com account, and the ability to edit the meeting type you want to track.
- Your Cal.com scheduler embedded on your own website. This is required, not a preference, and the next section explains why.
- For Payment Tracking: payments already set up on that meeting type in Cal.com, through one of their payment apps.
- Access to edit your website’s code, or someone who can paste snippets for you.
Your affiliates must link to your site, not to Cal.com
This trips people up more than anything else in this guide. Referly recognises a referred visitor only on pages carrying the Referly tracking script. You control your own website, so the script can go there. You don’t controlcal.com, so it can’t go there. An affiliate link pointing straight at your Cal.com booking page is invisible to Referly, and nothing you set up afterwards can rescue it.
Both setups also read the referral out of the page the embed is sitting on, which is another reason the scheduler needs to be on your site rather than somewhere you send people away to.
Add the Referly tracking script to your site
Both setups need this. It’s what notices a visitor arriving on an affiliate link and remembers it in their browser for the length of your cookie window. Copy it from Step 1: Tracking clicks in whichever instructions window you opened. Your program’s own identifier is already filled in whereYOUR_PROGRAM_ID appears here:
head section of your site, site-wide if you can. On Webflow that’s Site settings, then the Custom code tab, then Head code, followed by publishing. On WordPress, look for a “header scripts” setting in your theme or a header-and-footer plugin. In Google Tag Manager, use a Custom HTML tag firing on All Pages.
It has to be on the page holding your Cal.com embed, and on every page an affiliate might send someone to.
Find your embed’s namespace
Both setups need this one small detail, so it’s worth doing before you go further. When you generate an embed, Cal.com gives you a block of code containing a line that looks like this:init is the namespace. In that example it’s 15min. It’s usually named after the meeting type, and the rest of the embed code refers back to it, as in Cal.ns["15min"](...).
Write yours down. Every snippet below has a placeholder where your namespace goes, and getting it wrong is the single most common reason nothing happens.
origin in that line points at your own installation rather than https://app.cal.com. Leave whatever Cal.com generated for you exactly as it is.Set up Referral Tracking
Use this path if your meetings are free. It records each booking as a referred customer with no revenue attached. Copy the script from Step 2: Setting Up Referral Tracking Scripts in the Cal Referral Tracking instructions window, and paste it into your page below the Cal.com embed code, so the embed exists before this runs. ReplaceINSERT_YOUR_NS_HERE with your namespace, and note that YOUR_PROGRAM_ID is already filled in for you in the version inside Referly:
Set up Payment Tracking
Use this path if you charge for the meeting through Cal.com. It’s two pieces of work: teaching your embed to carry the referral, then telling Cal.com to notify Referly.Add the referral to your embed code
Cal.com’s embed generator gives you code like this:init line onwards with the version from Step 2: Setting Up Sales Tracking in the Cal Payment Tracking instructions window. There’s an Inline tab and a Floating Buttons tab there, so pick the one matching your embed.
Here’s the inline version:
Your namespace
15min with your own namespace, including inside Cal.ns[...].Your calLink
your-name/15min with the calLink value Cal.com generated for you.Your element selector
#my-cal-inline-15min with the elementOrSelector value from your generated code.The rest of your config and ui settings
"metadata[referlyAff]": affLink line inside config. Don’t remove your existing settings to make room for it.Add the webhook in Cal.com
Now tell Cal.com to notify Referly when a booking is made or paid for.Open your webhook settings
Paste the subscriber URL
program_id= tells Referly which program the bookings belong to.Choose the event triggers
- Booking Created
- Booking Paid
Leave the secret blank
Create it
Test it end to end
Do this before telling any affiliate the integration is live.Grab a real affiliate link
Open it in a private window
Book a slot
Check Referly
Check it appeared once, not twice
How Referly decides who gets the credit
When a visitor lands on your site through an affiliate link, Referly records the click and keeps it in their browser for as long as your cookie window allows. When they book, that stored referral travels with the booking, either passed straight to Referly by the referral script or carried inside the booking itself for Payment Tracking. Referly looks it up and credits the affiliate behind it. If Referly can’t find the exact click, it falls back to matching against your affiliates’ referral codes, which keeps things working when someone clears their cookies mid-visit. Everything depends on that stored referral existing. A booking made in a different browser, on another device, or after your cookie window has run out won’t be credited to anyone. And once a customer is credited to an affiliate, that credit stays put: later clicks from other affiliates don’t take it over.Limitations to be aware of
- Only the booking is tracked. Cancellations, reschedules, no-shows, and refunds never reach Referly. A cancelled meeting stays in your reports as a referral.
- Referral Tracking never records revenue. Bookings arrive with no value. If you want money attached, either use Payment Tracking or add the sale by hand when the deal closes.
- The visitor must book in the browser they clicked in. Clicking on a phone and booking on a laptop won’t match.
- A bare
cal.comlink can never be tracked. Worth repeating in your affiliate onboarding notes. - Setup is per embed. A new meeting type embedded on a new page isn’t tracked until you repeat the steps for it.
- Payment Tracking’s provided setup covers inline and floating button embeds. The pop-up-via-element-click embed isn’t covered.
- Recurring meeting types are booked once, so they’re recorded once, not once per occurrence.
- Ad blockers and strict privacy settings stop the tracking script for a small share of visitors, as with any affiliate tool.
Troubleshooting
The scheduler doesn't appear at all after I edited the embed code
The scheduler doesn't appear at all after I edited the embed code
calLink, and, for inline embeds, your element selector all match what Cal.com generated. Restore the original embed code, confirm the scheduler comes back, then redo the edit one value at a time.Bookings happen but nothing appears in Referly
Bookings happen but nothing appears in Referly
init line of your own embed code, in every place the snippet uses it.Then check the ordering: for Referral Tracking, the script goes below the embed code. Check the tracking script is on that page too. And confirm you published the site after making the changes.Bookings appear but always with no revenue
Bookings appear but always with no revenue
Every booking shows up twice
Every booking shows up twice
Clicks are counted but bookings never are
Clicks are counted but bookings never are
A booking wasn't credited even though the customer used an affiliate link
A booking wasn't credited even though the customer used an affiliate link
cal.com address instead of their referral link. You can attach the referral to the right affiliate by hand from the customer’s page, described in managing referred customers.The amount is right but the currency looks wrong
The amount is right but the currency looks wrong