> For the complete documentation index, see [llms.txt](https://docs.humblytics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.humblytics.com/how-to-track-custom-form-submissions/cal.com/custom-self-hosted-how-to-track-cal.com-booking-submissions.md).

# Custom/Self-Hosted – How to Track Cal.com Booking Submissions

Embed Cal.com on any custom or self-hosted site with a small snippet that records each booking in Humblytics.

{% hint style="info" %}
**You need:** the Humblytics script in the `<head>` of your site, your Cal.com embed code, and its namespace. See [Cal.com](https://docs.humblytics.com/how-to-track-custom-form-submissions/cal.com.md) for how to get them.
{% endhint %}

## 1. Add the embed

1. Paste your Cal.com embed code into your page's HTML or template where the calendar should appear.
2. Directly below it, paste this snippet:

```html
<script>
  // Runs when someone completes a booking
  Cal.ns["30min"]("on", {
    action: "bookingSuccessfulV2",
    callback: function () {
      window.Humblytics.trackFormSubmission("demo-call");
    },
  });
</script>
```

3. Replace `30min` with your namespace, and `demo-call` with the name you want to see in Humblytics.

**Using React?** With `@calcom/embed-react`, get the API with `getCalApi({ namespace: "30min" })`, then call `cal("on", { action: "bookingSuccessfulV2", callback: ... })` with the same callback.

## 2. Deploy and test

1. Deploy your site.
2. Open the live page in a private window and make a test booking.
3. In Humblytics, go to **Observe → Analytics → Clicks & forms** and look for your booking name within a minute or two.

**Not showing?**

* The namespace in the snippet must match the one in your Cal.com code exactly.
* The snippet must run **after** the Cal.com code.
* Your embed code has no namespace (it uses `Cal("inline", ...)` instead of `Cal.ns[...]`)? Replace `Cal.ns["30min"]` with `Cal` in the snippet.
* If your site uses a Content Security Policy, allow `app.cal.com`.

Cancel the test booking in Cal.com afterward so it doesn't stay on your calendar.
