Repository navigation
Which Click-to-WhatsApp ad started a PAST chat? Recovering lost referral (sourceID/ctwaClid) #2925
Replies: 1 comment
|
We deal with CTWA attribution too, so here's what I'd try, roughly in order of how much I'd trust it. 1. Re-link one device with full history sync and scan the old messages. const sock = makeWASocket({
browser: Browsers.macOS('Desktop'),
syncFullHistory: true,
})
sock.ev.on('messaging-history.set', ({ messages }) => {
for (const m of messages) {
const msg = m.message?.extendedTextMessage ?? m.message?.imageMessage ?? m.message?.videoMessage
const ad = msg?.contextInfo?.externalAdReply
if (ad?.sourceId || ad?.ctwaClid) {
// save m.key.remoteJid + ad.sourceId + ad.ctwaClid
}
}
})To be upfront: I haven't confirmed on a real account that WhatsApp keeps the ad context in history-synced copies. The schema allows it, though, and it's the cheapest thing to test. Pick one number with a few known ad chats and check before rolling it out to all 25. For chats older than the initial window, 2. The 3. On the Meta side, I don't know of any per-chat backfill. 4. If you need a fallback heuristic: match each chat's first-message timestamp against which ads were delivering to that number at that time, and use the prefilled greeting text when your ads have distinct ones. That's usually the strongest signal. I don't have an accuracy number I'd stand behind, so I'd check it against the chats where you do have |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
We run Click-to-WhatsApp ads into ~25 WhatsApp numbers (linked devices; Cloud API only recently). For chats captured live we store
sourceID/ctwaClid/ctwaPayloadand know exactly which ad started the chat.Problem: for chats that started before a number was linked (or where the first ad message arrived as
@lidwith no phone and the person never wrote again), the referral is missing. That is most of our chats from the last 3 months.Is there any way to recover which ad started a past chat? e.g. history sync /
reverseHistorySync, app-state, Business Suite inbox, Meta Business Manager "conversation insights", Graph API, lid→phone, anything. Or a statistical method you trust per chat (and what accuracy you measured)?All reactions