Send Events to Meta’s Conversions API from Your WhatsApp Bot

Cesar Banchio Updated by Cesar Banchio

This guide explains how to send events to Meta’s Conversions API (CAPI) using the Graph API, in WhatsApp bots. This is useful for tracking conversions (e.g. leads, purchases, signups) after a user interacts with your bot.

🔐 Hashing Sensitive Fields

Meta requires all personal identifiers (like email and phone) to be SHA-256 hashed before sending. This is crucial for protecting user data and enabling accurate matching.

👉 Always lowercase and trim the data before hashing.

The data collection process on the bot would look like so:

We capture the information and with a formula block we use the Lower method to transform to lower case.

Next, we hash the data.

External Hashing API (No Code)

You can hash values using this free SHA-256 API

GET https://api.hashify.net/hash/sha256/hex?value=testvalue

Use a Webhook block to call this API.

Save the returned Digest into a new field (e.g. @sha_name).

📝 Note: Each webhook call hashes one field at a time. You'll need separate Webhook blocks for each identifier (email, phone, etc.).

Once we have collected and hashed all the information we want to send to Conversions API, we will use Graph API to send the data. This is the endpoint

POST https://graph.facebook.com/v18.0/<PIXEL_ID>/events?access_token=<ACCESS_TOKEN>

Example of payload

{
"data": [
{
"event_name": "Lead",
"event_time": 1720515610,
"user_data": {
"em": "@sha_email",
"ph": "@sha_phone",

"client_user_agent": "WhatsAppBot/1.0",

}

}
]
}

Notes

event_time: Unix timestamp (in seconds)

user_data: must be SHA-256 hashed

Was this article helpful?

WhatsApp - Get user out of error message loop

Contact