How to do Meta ads conversion tracking in WhatsApp bot using the Conversion API
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.).
📅 Generate Unix Timestamp
To generate a timestamp in your bot, use a Set Variable block with ${timestamp}

this gives the current Unix time, but includes a decimal (e.g., 1721101234.0).
To remove the decimal, follow it with a Formula block using: Replace(@timestamps, ".0", "")

This converts the value to a clean integer format (1721101234), which is required by APIs like Meta’s Conversions API for the event_time field.
📤 Send Data to Convertions API
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
For more information, you can review the Conversions API documentation