# Cal.com Integration

> Step-by-step guide to integrate Ours Privacy with Cal.com for tracking bookings and custom events while prioritizing privacy and HIPAA compliance.

Source: https://docs.oursprivacy.com/docs/calcom

Track Cal.com bookings and custom events in Ours Privacy with analytics built for **HIPAA-regulated workflows**.

## Cal.com Redirect (easy integration)

The simplest way to integrate Ours Privacy with Cal.com is to set up a redirect after booking. Here's how:

1. Make sure the Ours Privacy Web SDK is installed on your website.
2. Link from your website to a Cal.com booking page.
3. Set up a custom thank-you page in Cal.com to redirect back to your website.

On your thank-you page, fire this Ours Privacy event:

```javascript
ours('track', 'BookingCompleted');
```

This method requires no complex integration and provides basic tracking. Configure the redirect in your Cal.com booking page settings:

![](https://docs.oursprivacy.com/img/calcom/calcom-img-1.png)

***

## Ours Privacy Cal.com Source (custom integration)

For more advanced tracking and to access booking details, you can set up a custom integration with Cal.com. Follow these steps:

1. **Create a New Source**:
   * In the Ours Privacy dashboard, navigate to **Sources** and create a new source.
   * Select **Cal.com** from the options and copy the Webhook URL provided.

2. **Subscribe to Webhooks in Cal.com**:
   * Go to your Cal.com account settings.
   * Add a new webhook and paste the Ours Privacy Webhook URL.
   * Subscribe to the **Booking Created** event to capture booking data.

![](https://docs.oursprivacy.com/img/calcom/calcom-img-2.png)

3. **Submit a Test Booking**:
   * Make a test booking to ensure data is sent to Ours Privacy.
   * Check the Ours Privacy dashboard for pre-populated variables from the booking payload.

4. **Map Booking Fields**:
   * Use the field mapping interface in Ours Privacy to map Cal.com booking data to its attributes.
   * Include at least the **Ours Visitor ID** field and optionally an email address for user association.

***

### Advanced Source Integration

To link Ours Privacy visitor data with Cal.com bookings:

1. **Add a Hidden Field in Cal.com**:
   * Set up a hidden field in your booking page to capture the visitor ID.

2. **Pass Visitor ID via URL**:
   * When linking to the Cal.com booking page, append the visitor ID from `ours.getVisitorId()` as a URL parameter. Example:

```html
<a id="booking-link" href="https://cal.com/your-booking-page">Book Now</a>

<script>
  document.getElementById('booking-link').href =
    'https://cal.com/your-booking-page?ours_user_id=' + ours.getVisitorId();
</script>
```

3. **Map Hidden Field**:
   * Map the hidden field in the Ours Privacy dashboard to the visitor ID for accurate user tracking.

![](https://docs.oursprivacy.com/img/calcom/calcom-img-3.png)

***

### Key Benefits of the Ours Privacy Cal.com Integration

* **Built for HIPAA-regulated workflows**: Ideal for healthcare and other privacy-sensitive industries.
* **Custom Event Flexibility**: Track bookings, interactions, and more.
* **Enhanced Data Accuracy**: Server-side integration ensures reliable analytics.

For further assistance, contact [support@oursprivacy.com](mailto:support@oursprivacy.com).
