Customerlabs CDP Documentation

You are here:

Calendly is a popular tool used by customers to book appointments/meetings via personal scheduling links and tracking.

Calendly is a popular tool used by customers to book appointments/meetings via personal scheduling links and tracking.

Calendly tracking made it easy!

With Calendly, there are some limitations when it comes to directly updating the JavaScript code to track the lead information. 

Calendly isn’t exactly user-friendly in that department.

Here’s a simple workaround:

  1. UTM Term:  When a user submits a form, a unique user ID from CustomerLabs is assigned and transmitted via the URL query parameter utm_term.
  1. Use Webhooks for Lead Information: Connect Calendly to your system via a webhook. This webhook will directly receive the lead information.
  1. Unification of both browser and server-side lead event: Now, you can merge the server-side webhook data with the browser-side form submission data using the “CL Unique User ID”.

This approach improves the event match quality on Meta by ensuring that all customer information parameters are sent accurately.

This way, you’ll have a more efficient and streamlined process for tracking leads with Calendly, even with its limitations!

Wow – Meta event match quality shines for your Calendly

Optimizing the campaign with the high event match quality conversion event helps Meta algorithm to train better on what kind of prospects to attract.   

Higher reporting and attribution conversions on Google Adwords 

Similarly on Google Adwords, you will have higher attribution on the conversion because we store all the cookie ids including Gclid id. This helps improve the reporting and attribution. 

Now let’s follow the step by step instructions to configure the same.

A step-by-step guide to setting up Calendly forms:

1. Add the Tracking Script to Your Website

  • Sign in to your CustomerLabs account.
  • Place the tracking script above the </head> tag on your website.

2.  CustomerLabs Integration

To complete the integration with CustomerLabs, follow these steps:

  • Go to CustomerLabs→Navigate to Destination→Select Custom Integration.
  • Name the configuration as ‘calendly_integration’.
  • Update the script as shown below
  • Save the integration.

Script:

function updateCalendlyLinks(utmTerm) {

    document.querySelectorAll(‘a[href^=”https://calendly.com”]’).forEach(link => {

        try {

            const url = new URL(link.href);

            url.searchParams.set(‘utm_term’, utmTerm);

            link.href = url.toString()

        } catch (error) {

            console.error(‘Error updating Calendly link:’, error)

        }

    })

};

updateCalendlyLinks(window.CLabsgbVar.generalProps.uid);

function updateCalendlyLinks(utmTerm){document.querySelectorAll(‘a[href^=”https://calendly.com”]’).forEach(link=>{try{const url=new URL(link.href);url.searchParams.set(‘utm_term’,utmTerm);link.href=url.toString()}catch(error){console.error(‘Error updating Calendly link:’,error)}})};updateCalendlyLinks(window.CLabsgbVar.generalProps.uid);

Steps to Subscribe to the Calendly API/Webhooks:

3. Sign in to your Calendly account:

  •     Navigate to Integrations & Apps → API & Webhooks

4. Create a Webhook Subscription:

  •    To create a webhook, you’ll need to authenticate using either a personal access token or an OAuth application.

5. Generate theAuth Token:

  •  Click on Generate New Token
  • Name it as “Calendly token” or as per your preferred naming convention.
  • Once the token is created, make sure to save it in a notepad or document. You’ll need this token for the upcoming steps.

6. Webhook Subscription:

  • When you create a webhook subscription, your end-point receives real-time updates for scheduled or canceled events, or routing form submissions and the calandely’s webhook subscription documentation is attached for reference
  • When you create a webhook subscription, your end-point will get real-time 

updates whenever events are scheduled or canceled by the host or invitee

.

  •  You can choose to subscribe invitee.created: Receives data about scheduled events by invitees.
  • invitee.canceled: Receives data about canceled events by invitees.
  • routing_form_submission.created: Receives data about routing form submissions, whether or not a booking happens.
  • Subscribing to both invitee.created and invitee.canceled gives you updates for all scheduled and canceled events across your team.
  • Subscribing to routing_form_submission.created will notify you whenever a routing form is submitted, regardless of whether a booking happens. Note: This event can only be subscribed to at the organization level.

7. Retrieve User and Organization URIs

  • To continue with the integration, you need to retrieve your user URI and organization URI from Calendly, follow the steps below:
  • Open your Postman tool,Navigate to  the Collections tab, click on the Import option to import the request shown below and replace the acess_token with your token which has been created earlier

curl –request GET \

–url https://api.calendly.com/users/me \

–header ‘authorization: Bearer {access_token}’

  • Now review the postman response payload, look for the value of current_organization in the response to get your organization URI or uri in the response to get your user URI, which will be used in upcoming step

8.Create a Webhook in CustomerLabs to receive the data

  • Sign in to your CustomerLabs account.
  • Go to Source → Connect Source→Select Custom Source.
  • Name the integration as  ‘Calendly Integration’.
  • Once the integration is created, copy the webhook URL provided by CustomerLabs.
  • This URL will be used to receive data from Calendly.
    • curl –request POST –url https://api.calendly.com/webhook_subscriptions
      –header ‘Content-Type: application/json’
      –header ‘authorization: Bearer <your personal access token>’
      –data ‘{
      “url”:”http://yourserverendpoint.com”,
      “events”:[“invitee.created”,
      “invitee.canceled”],
      “organization”:”https://api.calendly.com/organizations/AAAAAAAAAAAAAAAA”,
      “scope”:”organization”}’

9. Webhook Subscription in Calendly

  • Open your Postman tool, Navigate to  the Collections tab, click on the Import option to import the request shown below and replace the acess_token with your token which has been created earlier.

curl –request POST –url https://api.calendly.com/webhook_subscriptions \

–header ‘Content-Type: application/json’ \

–header ‘authorization: Bearer <your personal access token>’ \

–data ‘{

  “url”: “http://yourserverendpoint.com”,

  “events”: [“invitee.created”, “invitee.canceled”],

  “organization”: “https://api.calendly.com/organizations/AAAAAAAAAAAAAAAA”,

  “scope”: “organization”

}’

  • Note: Replace the access token with your token which has been created earlier, replace the url with the webhook url created from CustomerLabs and replace the organization path from the previous payload response and an example post request data is given below

curl –request POST –url https://api.calendly.com/webhook_subscriptions

–header ‘Content-Type: application/json’

–header ‘authorization: Bearer <your personal access token>’

–data ‘{

“url”:”https://hook.customerlabs.co/source/calendly-4426/”,

“events”:[“invitee.created”],

“organization”:”https://api.calendly.com/organizations/1c5160c9-0555-4bfd-bb3e-15ffd7187a74″,

“Scope”:”organization”}’

Note: Here, we are using the organization path that was created earlier in the GET response.

  • Note: In this case, data will only be sent to the webhook when the user schedules an invite. You can customize the webhook to track different events as per your requirements, such as invitee.created, invitee.canceled, or routing_form_submission.created, as explained above.
  • To test the webhook, schedule a meeting via your calendly link. This will trigger the invitee.created event and send the data to you CustomerLabs webhook URL.

10.What is a Workflow?

  • A Workflow helps you to turn the raw data you receive from the source into specific event data based on the workflow configuration which includes filtering and modifying the parameters. You can create multiple workflows inside 
  • Source. A workflow is a one-time setup that constantly receives customer data & updates user profiles in CustomerLabs in real time. 
  • Once a Source platform is authenticated, users can build workflows without writing a single line of code. 

11: Setup the workflow

Name your workflow

This helps you quickly select relevant workflows – just for internal purposes. 

Example: If you want to receive the data of users whose stage is changed to “Lead” in your CRM through this workflow, you can name this workflow “lead_updated” or “lead_created”.

Workflow Delay

Workflow delay is recommended when you have multiple workflows in a source.

The data coming into the source will be sent across the workflows at the same time if the workflow delay is not given. This may result in concurrency issues.

For example, Whenever a user enters from the source, CustomerLabs checks if the user is already available in the database or assigns a unique user id to the user. Say, you have 4 workflows for the source and when the data is sent across all the workflows at the same time, 4 new user ids will be created for the same user if the user is not there in the database. Hence, setting up the delay time will make sure the new user is assigned a single unique ID.

Name your workflow

12: Choose sample data

To receive event samples, trigger an event in that particular Source. For example, if you’re setting up a workflow to receive contact information as and when it gets updated in your CRM. Update a test contact in your CRM to receive event information in CustomerLabs. 

Fetch new data

You will be able to update up to 5 samples at once. Fetching sample data in a few source platforms might take time. In that case, please wait for some time before you try again. 

You can view the incoming sample data and select the sample that suits your use case. 

You can view the incoming sample data and select the sample that suits your use case. 

Data Selection- Sample data

Note: While selecting the sample, ensure the data contains no parameters with null values as given in the image and check if the cluid is passed in the source log

The Customer Labs will not process parameters with null values. This is because null values are not considered valid data by the destination. If the sample data consists of any field with a null value, it will not be pushed to the destination.

We suggest passing all the required parameters with a value or an empty string.

For example, if the parameter is “first_name”, you could pass the value “John Doe” or the empty string

 Only if you pass all the required parameters with a value or an empty string, we can process the data and send them to the integrated destinations successfully.

 13: Event Configuration:

Event configuration is the workflow setup’s final and most important step.

13.1. Event name

Assign the event name by selecting from the drop-down as shown below and choosing the custom event and name it cl_leads or cl_ registration 

Naming your event
Event Name

13..2 User Identity Mapping

As previously mentioned, we are capturing the “cluid” using a hidden field. This “cluid” serves as an identifier that helps in the unification of both browser and server-side events and mapping the “cluid” as an identifier is an important step in integration and in this scenario, we have taken we are getting the cluid from the UTM term as mentioned above

You can choose upto 3 different identifiers including external IDs to map user information. These external IDs will be stored by CustomerLabs to create an enriched user profile

13.3 User traits: 

All user/contact/individual-related information can be added under user traits and a screenshot example is given below

Event Configuration
User traits mapping

To send the user traits to the destination, you must map the user details under this section. This mapping process will allow you to send this valuable user information to the intended destination.

For example, if you’ve set up a workflow to receive all contact updates from your CRM to CustomerLabs. Information such as Contact first & last name, phone, email, address, company, lifecycle stage, job title etc. can be added under user traits.  One such scenario would be when you want to run an email campaign with Klaviyo, you should add email ID as a user trait in this section to pass this information to Klaviyo or any such destinations in this case.

Source Logs

Source Logs show a list of events received by the source webhook before being sent to the workflows for event processing. There may be a delay in displaying the events items of up to 10 minutes, which is currently optimized.

You can see the logs by clicking on “Logs” from a particular source as shown below.

Source Logs

Every single message received by CustomerLabs will have a unique message id and we’ll be logging them so you can see how it is being processed in various workflows before appearing in the event manager.

Source ‘Data in’ log

The below image shows the log data of the message received from that particular source and data variables in JSON format.

Source ‘Data in’ log

Source ‘Data out’ log

The below image shows the log data of the message processed and sent to respective workflows along with a new message id.

Source ‘Data out log

Workflow Logs

Individual workflows will also have their own logs, and you can use them to see how the event is transformed including user traits, event attributes, group(account) traits, external ids, group(account) identities, and other attributes.

Workflow Logs

Few tips on workflow status messages in ‘Data out’

You’ll see the following messages in the workflows and the reasons are listed below.

a) Mapping not found – When a workflow is in draft mode, the message as “Mapping not found” is thrown.

b) Filter condition failed – When a workflow filter condition is failed, this message is thrown.

c) User ID missing or Account ID is missing – We assume every event should have User identity or account identity fields. When the data is missing we’ll throw an error and the event won’t be processed further.

d) Data not found – This message means the data is still being processed, sometimes when there are lot of requests the systems will take up to 10 minutes to process the data.

Destination

Send incoming data to third-party apps to boost marketing effectiveness. Learn more about the destination tools we support.

You want to explore? Need a hand – happy to help, always! 

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
How Can We Improve This Article?
Need help?
Table of Contents
CustomerLabs gives freedom, flexibility and wings to digital marketers.
Sign Up

Schedule a 1-1 Demo

E-commerce icon
Ecommerce

Unified data to boost ecommerce growth

B2B icon
B2B

Engage your customers across the funnel with a unified martech stack

SaaS
Saas

Increase product metrics with a unified martech stack

Agency
Agency

Scale your customers quickly with the right data