Telecrm Integrations
Setup for CTWA
Prerequisites are in place. Your Dataset ID is ready. Your telecrm account is set up. Now it's time to bring it all together.
In this video, we'll go through the complete configuration of the Meta Conversions API for Click To WhatsApp ADS (that is, the CTWA Ads)— step by step.
We'll cover two phases —
Phase 1 — Setting up your Dataset on Meta and generating your Access Token and Endpoint URL.
Phase 2 — Connecting it all inside telecrm by creating the API Template, mapping your Facebook Lead ID, adding the payload, and testing the integration end-to-end.
By the end of this video, your telecrm and Meta will be talking to each other.
PHASE 1: Set Up Your Dataset on Meta
STEP 1 — Log In to Meta Business Manager
1. Open a new browser tab and go to business.facebook.com. Sign in to your account.
2. From the left-hand menu — navigate to Events Manager and click on Connect Data.
STEP 2 — Create or Select a Dataset
3. A window will appear asking you to connect a new data source. Select CRM from the list and click Next.
If you already have a dataset, select it from the dropdown list.
If you don't have one yet, click Create New Dataset and give it a name.
STEP 3 — Choose Manual Connection
4. On the next screen, click on Connect Manually.
5. Select "Do the code manually yourself" — this is the recommended option as it gives you full control over the connection.
6. Click Next.
STEP 4 — Generate Your Access Token and Endpoint URL
7. You will land on a new page. Scroll down to the Create Endpoint section and click on Generate Access Token.
8. Once generated, you will see your unique Endpoint URL.
⚠️ Critical — Copy and store both your Endpoint URL and Access Token immediately and securely. Meta will NOT display the Access Token again once you leave this page.
- Open telecrm web application > Click on settings, go to lead fields, click on "add a new field", type the name CTWA ID, choose type text, and click on create. Now, from the side dashboard, go to automations, go to workflows, then click on create workflow, search for On whatsapp lead event and select your WACA correspondent event, then under the actions on the left-hand side, click on update lead field event and search for ctwa id lead field now click on select variable and from the dropdown click on CTWA Action Variables, click on CTWA Click id and click on save, then publish your flow.
Step 5: Add the Payload
In order to get the WABA ID, go to the Integrations page, click on WhatsApp Cloud API, and go to the Manage option. You will find the ID below your WhatsApp API Configuration name, copy it, and click on the whatsapp cloud api configuration name to open the profile setup page. Under the access token, click on the edit icon, copy the system user access token, and click on the cross. Use this WABA ID in further steps.
Step 1 — Create or Retrieve Your Dataset ID
Before setting up the CTWA payload, you first need to make a Dataset API Call to either create a new Dataset or retrieve your existing one.
Dataset Endpoint —
https://graph.facebook.com/v16.0/{{WABA_ID}}/dataset?access_token={{System_User_Access_Token}}
Now, go to Telecrm's web application, go to automations, and click on API templates.
Click on create new and give your api template a good name. We are using "Creating Dataset" in our case,
Now paste the endpoint URL in the endpoint URL section and simply replace {{WABA_ID}} with your WhatsApp Business Account ID and {{System_User_Access_Token}} with your System User Access Token and make the call.
- If a Dataset does not exist, it will be automatically created and return a new Dataset ID.
- If a Dataset already exists, it will simply return your existing Dataset ID.
Copy this Dataset ID — you will need it in the Endpoint URL for the next step
Click on Continue to response mapper and select ID in the available JSON paths, and click on save
Now, in the api templates section, click on create new again.
Give your api template a s good name. In our case, we are using "CTWA CAPI".
Now, copy the endpoint URL from the description of this video and replace the dataset ID with the one you copied in the previous step and also add the system user access token and paste it in the endpoint URL section
https://graph.facebook.com/v16.0/{{Dataset_ID}}/events?access_token={{System_User_Access_token}}
Now, click on the body tab and paste the payload mentioned in the description
Payload —
json
{
"data": [
{
"event_name": "Purchase",
"event_time": "{{$date({{now,seconds}})}}",
"action_source": "business_messaging",
"messaging_channel": "whatsapp",
"user_data": {
"whatsapp_business_account_id": "{{Your WABA ID}}",
"ctwa_clid": "{{ctwa id}}"
},
"custom_data": {
"currency": "USD",
"value": "{{Last Order Amount}}"
}
}
]
}
This payload is specific to Click to WhatsApp leads.
- The action_source is set to "business_messaging" — telling Meta this conversion originated from a WhatsApp conversation
- The messaging_channel is set to "WhatsApp."
- Instead of a lead_id, you are passing the CTWA Click ID (ctwa_clid), which is the unique identifier for CTWA leads.
- The WABA ID links the conversion to your specific WhatsApp Business Account
- The custom_data includes the currency and value of the conversion, making it ideal for tracking purchase or revenue events
Note: There are multiple events that we can use CTWA CAPI, such as Purchase, Lead Submitted, and Qualified Lead.
If we are using the Purchase event, it is mandatory to add the currency values, as it is a revenue-bearing event.
For the rest of the events, we do not need the currency and value fields, so we can just remove the custom data entirely, which makes our payload like this.
For the Lead submitted or qualified lead event, the payload will look like this:
{
"data": [
{
"event_name": "Lead Submitted",
"event_time": "{{$date({{now,seconds}})}}",
"action_source": "business_messaging",
"messaging_channel": "whatsapp",
"user_data": {
"whatsapp_business_account_id": "{{Your WABA ID}}",
"ctwa_clid": "{{ctwa id}}"
}
}
]
}
You can copy this payload from the description as well and change the event name to Lead Submitted or Qualified Lead, according to your use case
And that's the complete Meta Conversions API setup for Click To WhatsApp Ads. Meta is no longer flying blind. It now has real, accurate, CRM-level conversion data to work with.
This was a one-time setup. But the impact it creates runs forever.