# Calendly Integration

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

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

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

## Calendly Redirect (easy integration)

The simplest way to integrate Ours Privacy with Calendly 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 Calendly booking page.
3. Set up a custom thank-you page in Calendly 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 Calendly booking page settings.

> **Note:** Some features may require a paid Calendly plan.

## Calendly Embed Event Tracking

Another way to track conversions on Calendly is to embed the scheduler on your website.

You can then listen to schedule events via the on-website events Calendly publishes, and track them using the [Ours Privacy Tag Manager](https://docs.oursprivacy.com/docs/tag-manager) or the Web SDK.

* Use the [Ours Privacy Tag Manager](https://docs.oursprivacy.com/docs/tag-manager) to create triggers for Calendly's dataLayer events
* Or use the Web SDK directly to call `ours('track', 'Calendly Booking')` when events fire

***

## Ours Privacy Calendly Source (custom integration)

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

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

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

> **Note:** Webhook access requires a paid Calendly plan.

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 Calendly 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 Calendly bookings:

1. **Add a Hidden Field in Calendly**:
   * Set up a hidden field in your booking page to capture the visitor ID.
   * Calendly recommends using `utm_term` for this [Docs](https://community.calendly.com/featured-tips-tricks-32/hidden-fields-what-they-are-and-how-to-use-them-1929)

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

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

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

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

***

### Key Benefits of the Ours Privacy Calendly 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).
