Ledger entryNo. 316374
Attribution
Also called: Marketing attribution · WhatsApp attribution · Revenue attribution · Attribution model
- Growth & marketing
- Practitioner
- Marketers
- Business owners
- Definition
- Linking WhatsApp touchpoints such as ads, templates and chats to the revenue they produce, using click IDs, UTM tags and order data.
Growth & marketing
Mode · flow diagram
Work it out
Follow the trail from touchpoint to rupee
- CTWA ad to WhatsApp chat: tap
- wa.me link to WhatsApp chat: prefilled
- Template to Website visit: click
- WhatsApp chat to Order: in-chat order
- Website visit to Order: checkout
- Order to Conversions API: report
- Order to Attribution model: credit
Hop 6 of 6
OrderAttribution modelcredit
Arrives at Attribution model — last touch, 7 days.
Hop 6 of 6: Order to Attribution model — credit.
What is attribution?
Attribution is the work of connecting each sale, booking or lead to the marketing touchpoints that led to it — and, when there were several, deciding how much credit each one gets. In WhatsApp marketing the touchpoints are Click-to-WhatsApp ads, template messages with links, click-to-chat entry points and the conversations themselves; the outcome is an order, a payment or a qualified lead recorded somewhere else, in a store, a CRM or a booking system.
Three identifiers carry the trail. A chat that starts from an ad arrives with a webhook referral object containing the ad's source_id and its click ID, ctwa_clid. A template's URL button can carry UTM parameters (and, with a dynamic URL suffix, a per-recipient token) so the website session is tagged with the campaign. And because every chat is tied to a WhatsApp ID — the customer's phone number, or since 2026 a business-scoped user ID when the customer uses a username — orders can be joined back to the messages that customer received.
An attribution model is the rule that shares out credit: last touch gives it all to the final touchpoint before the order, first touch to the one that introduced the customer, linear splits it evenly, and time-decay favours recent touches. Every model needs a window — how long after a touch an order still counts. Attribution is different from the Conversions API for Business Messaging, which is one tool for reporting outcomes back to Meta, and from incrementality, which a holdout group measures. Its output is what campaign analytics and each campaign's conversion rate are built on.
Key takeaways
- Attribution decides which WhatsApp ad, template or chat gets credit for an order, so budgets follow what actually sells.
- Three join keys do most of the work:
ctwa_clidfrom ad chats, UTM tags on template links and the customer's WhatsApp ID on orders. - Pick one model (last touch, first touch or linear) and one window, such as 7 days, before reading results.
- Attribution shows where credit goes; only a holdout group shows whether WhatsApp created the sale at all.
Why does attribution matter?
Without attribution, WhatsApp is judged on reads and replies while the money shows up as "direct" or "organic" in other reports, and budgets drift to channels that are easier to measure rather than better. With it, a marketer can say that the Diwali reminder template produced 2.1 lakh rupees in orders at a known messaging cost, that one ad set fills the funnel while another closes it, and which conversations are worth paying an agent to handle.
How does attribution work?
Tag every outbound link
Add
utm_source=whatsapp,utm_medium(template, chat, broadcast) andutm_campaignto URL buttons and links, plusutm_contentfor A/B variants. Use a dynamic URL suffix when you need a per-recipient token.Capture ad context the moment a chat starts
Store
referral.source_id,ctwa_clidand the received time from the first inbound message of a Click-to-WhatsApp ad chat, keyed by itswamid. The referral does not repeat later in the thread.Record the WhatsApp ID on every order
Orders placed in chat, on the site from a template link, or by an agent should store the customer's WhatsApp ID (and BSUID where you have it). That is the key that joins revenue to messages.
Choose a model and a window
Agree on, say, last touch within 7 days for weekly reporting and first touch for acquisition budgets. Write it down; numbers from different models are not comparable.
Report back and check incrementality
Send ad-attributed purchases to Meta with the stored
ctwa_clid, compare your own totals with Ads Manager's, and run a holdout group now and then to see how much of the attributed revenue is truly extra.
In code
Attribution in code
-- Credit each order to the customer's most recent WhatsApp touch-- in the 7 days before it (PostgreSQL).WITH touches AS (SELECT wa_id, received_at AS touched_at, 'ctwa_ad' AS channel, source_id AS campaignFROM ad_referralsUNION ALLSELECT wa_id, clicked_at, 'template_link', utm_campaignFROM link_clicks),ranked AS (SELECT o.order_id, o.value_inr, t.channel, t.campaign,ROW_NUMBER() OVER (PARTITION BY o.order_id ORDER BY t.touched_at DESC) AS rnFROM orders oJOIN touches tON t.wa_id = o.wa_idAND t.touched_at BETWEEN o.created_at - INTERVAL '7 days' AND o.created_at)SELECT channel, campaign, COUNT(*) AS orders, SUM(value_inr) AS revenue_inrFROM rankedWHERE rn = 1GROUP BY channel, campaignORDER BY revenue_inr DESC;
Swap ORDER BY t.touched_at DESC for ASC to get first touch. Orders with no touch in the window stay unattributed, which is the honest answer.
Example: One saree order, three touchpoints
A Surat saree seller sees a customer tap a Click-to-WhatsApp ad on 2 October, chat with an agent about silk blends, then go quiet. On 9 October she receives the festive-collection marketing template, taps "View collection" (tagged utm_campaign=navratri_2026) and orders on the website the next day for 6,400 rupees. Last touch credits the template; first touch credits the ad; linear gives each half. The team reports last touch weekly, uses first touch when deciding next month's ad budget, and sends the purchase to Meta with the ad's ctwa_clid so Ads Manager can count it — then reconciles both views so the order is not counted twice.
The figures
Attribution: key facts and limits
- Ad chat key
- ctwa_clid and source_id in the webhook referral object
- Link key
- UTM parameters on URL buttons and links
- Customer key
- WhatsApp ID (phone number) or BSUID
- Common models
- Last touch, first touch, linear, time-decay
- Typical window
- 7 days after the touch (choose and document yours)
- Dynamic URL variable
- One per URL button, at the end of the URL
- Incrementality check
- A holdout group that receives nothing
Costly mistakes
Common mistakes with attribution
Counting the same order in every tool
Ads Manager, web analytics and your CRM each apply their own model and window, so their totals add up to more than your revenue. Pick one source of truth for the business report and use the others for their own optimisation.
Losing the referral on the first message
If the webhook handler or inbox middleware drops the
referralobject, the ad link is gone for good. Persist it before any bot logic runs and check it survives every hop to the CRM.Orders that never touch a tagged link
Customers often order inside the chat, by phone or by cash on delivery, so no UTM ever fires. Store the WhatsApp ID on those orders too, or WhatsApp will look weaker than it is.
Reading attribution as proof of lift
A loyal customer who would have reordered anyway still gets attributed to the last template. Use a holdout group to measure how much of the credited revenue is truly incremental.
Attribution FAQs
- How do I track sales from WhatsApp messages?
- Tag every link in your templates with UTM parameters and store the customer's WhatsApp ID on each order. Then join orders to the messages, clicks and ad chats that customer had within your attribution window.
- Which attribution model should I use for WhatsApp?
- Use last touch within a short window for weekly reporting, because it is simple and stable. Check first touch when planning acquisition budgets, and use a holdout group when you need to know the true lift.
- Can I attribute WhatsApp chats to Facebook and Instagram ads?
- Yes, for chats started from a Click-to-WhatsApp ad. The first inbound message carries a referral object with the ad's
source_idandctwa_clid, which you store and later send back to Meta with conversion events. - Why does Ads Manager show more WhatsApp conversions than my CRM?
- Ads Manager applies its own attribution setting and may credit an ad for orders your CRM credits elsewhere or cannot see. Compare like with like — the same window and the same order list — before deciding which number is wrong.
Best practices for attribution
- Use one UTM naming scheme across every team, in lower case, and keep it in a shared sheet.
- Store the BSUID alongside the phone number: when a customer adopts a username, webhooks can omit the number.
- Report attributed revenue next to messaging spend so cost per order is on the same page.
- Re-run the last-touch and first-touch views side by side once a quarter to see which campaigns open and which close.
Put Attribution to work
InfiQ is an official Meta Business Partner. Start a 7-day free trial — no card needed — and see this running on your own number.