Website to WhatsApp Attribution: 2 Reliable Ways to Keep Campaign Source
A visitor clicks your ad, lands on your site with the campaign written in the URL, then taps your WhatsApp button to ask a question. At that moment the conversation jumps to WhatsApp, and the campaign that sent them does not come along. The chat opens with a phone number and a first message, and nothing that says which ad, audience or keyword produced the lead. This is the core problem of website to WhatsApp attribution, and it is one of the most common blind spots for businesses that run ads to a WhatsApp button.This post is the website side of the problem, where a visitor is on your own site and taps a link to start a chat. It is a deeper look at a step introduced in the
UTM and click ID tracking guide. Click-to-WhatsApp ads, where the ad itself opens WhatsApp, are a separate case covered briefly near the end.
What happens to campaign source when a visitor taps a WhatsApp button
On the landing page, the UTM parameters and click IDs are present, but only in the URL of that page. A WhatsApp button is a link that opens the WhatsApp app, usually through a wa.me address. When the visitor taps it, the browser hands them off to WhatsApp, and the website URL, along with everything stored in the page, stays behind in the browser. WhatsApp has no reason to know your page existed, so none of that data travels into the chat on its own.The result is that the lead arrives in WhatsApp, and later in your CRM, with no source attached. You can see that someone messaged you, but not the campaign behind them, so reporting treats paid WhatsApp leads the same as organic ones. Fixing website to WhatsApp attribution means deliberately carrying a piece of information across that handoff, because nothing carries it for you.
What to store on the landing page first
Before any of this works, the source has to be captured and kept while the visitor is still on your site. As the landing page loads, the UTM values and click IDs are read from the URL and stored, usually in a first-party cookie on your own domain, so they survive the visitor moving around before they tap the button. This is the same capture step every other part of the tracking depends on, and without it there is nothing to carry into the chat.Once the source is stored, the question becomes how to move a reference to it across to WhatsApp. There are two reliable ways, and they differ in how much they can carry and what they need behind them.
Way 1: a reference inside the prefilled message
A WhatsApp click-to-chat link can open the chat with prefilled message text already typed in the box. This is a standard feature of these links, and it is the simplest place to carry source. You build the button link so the prefilled text includes a short line that states the source, medium and campaign, drawn from the values you stored on the landing page. When the visitor taps the button, the chat opens with that line already in the message, and when they send it, the source arrives as part of the first message.The strength of this approach is that it needs nothing on your side beyond building the link correctly. There is no server to run and no lookup to perform, because the information is sitting in the message itself. For many lead-gen setups, a readable line like the campaign name in the first message is enough to tell your team or your automation where the lead came from.The trade-off is that the reference is visible in the text, so it should be short and unobtrusive, and it can only carry as much as you are comfortable showing in the message box.
Way 2: a short token matched on a server
The second way keeps the message clean and moves the detail off to your own server. Instead of writing the full source into the prefilled text, you place a short token there, a brief code that means nothing on its own. At the same time, the full visit details, the UTMs, the click IDs, first and last touch, are stored on a server under that token. When the first message arrives carrying the token, your system looks the token up and recovers the complete source behind it.This carries far more than a single line of text can, and it keeps the visible message tidy, which suits businesses that want full attribution data without a block of parameters in the chat. The cost is that it needs a server endpoint to store and resolve the tokens, so it is more to build and maintain than the inline method. This token approach is my own design, not a feature of Meta or WhatsApp, so it exists only if you build it.One practical note for both ways: links of the form wa.me/message/… are WhatsApp short links, and these are left untouched rather than rewritten, because they resolve on WhatsApp’s side.
What website to WhatsApp attribution cannot do
Honesty matters more here than in most tracking topics, because the handoff has real limits that no setup removes.The first is that the prefilled text is editable. The visitor can change or delete the message, including your reference or token, before they send it. If they clear it and type their own question, the source is gone for that lead. This means website to WhatsApp attribution raises how often you can connect a WhatsApp lead to its campaign, but it never makes it certain, and any honest setup treats a share of leads as unmatched.The second is the shift in how WhatsApp identifies people. Meta is rolling out WhatsApp usernames and a Business Scoped User ID in 2026, which changes how businesses recognise a contact and weakens matching that leans on the phone number. The exact status moves over the year, so check Meta’s current documentation on business-scoped user IDs for where it stands when you build, and do not design around the phone number alone.The third is a boundary worth stating plainly: carrying a reference into a chat tells you the campaign for your own records. It is not the same as Meta accepting that chat as a conversion, and this post makes no claim that it does.
How this differs from Click-to-WhatsApp ads
Everything above is about a visitor already on your website. Click-to-WhatsApp ads are different: the ad itself opens WhatsApp, and Meta provides a value called ctwa_clid that identifies that ad click. That value arrives through the messages webhook on the WhatsApp Business side, not from any URL on your website, so it has nothing to do with your website button. If your traffic comes from Click-to-WhatsApp ads rather than a website visit, that is a separate case and is not covered here.
Does it hold up in practice?
From my own test, in the Facebook and Messenger in-app browsers the prefilled text on a WhatsApp link arrived intact when I sent myself the message. That is the specific scope I checked, and I will not stretch it further, because results can differ across other browsers, phones and setups, and the only honest claim is the one you have verified. Treat your own environment the same way: test before you trust it.
Consent
Storing click IDs in a cookie may need visitor consent in some regions, so the capture that feeds all of this should be consent-aware and wait for the appropriate signal before it stores anything. My capture script waits for consent by default. The right configuration depends on where your visitors are and the rules that apply to them, so build consent in from the start rather than bolting it on later.
Test your own setup
You can check your website to WhatsApp attribution yourself in a few minutes.
- Open one of your landing pages with test UTM values in the URL, then tap your own WhatsApp button.
- Does the chat open with prefilled text, and does that text contain your reference or token?
- Send the message to yourself and confirm the reference actually arrives in the received message.
- If you use the token method, confirm your server resolves the token back to the full source.
- Clear the prefilled text and send a plain message, and confirm your process treats that lead as unmatched rather than guessing.
If the reference is missing at any step, that is where the handoff is breaking.
Get it built or checked
If you want this reviewed rather than done yourself, a written review of where source is being lost across your site and WhatsApp handoff is a
UTM and click ID tracking audit. Having the capture, the button links, the reference or token method and the consent gate built and tested for you is the
UTM and click ID tracking setup.For the official reference on the links themselves, WhatsApp documents them in
how to use click to chat.
Frequently asked questions
Why does my WhatsApp lead show no campaign source?
Because tapping a WhatsApp button hands the visitor from your browser to the WhatsApp app, and your page URL, where the UTMs and click IDs live, stays behind. Nothing carries the source into the chat unless you deliberately place a reference in the message or use a token matched on your server.
Can I guarantee every WhatsApp lead is attributed?
No. The prefilled message text is editable, so a visitor can delete your reference or token before sending. This raises how often you can match a lead to its campaign, but it is never certain, so a share of leads will always arrive unmatched.
What is the difference between the inline reference and the token method?
The inline method writes a short line of source into the prefilled message, needs no server, and carries only what you show. The token method puts a short code in the message and stores the full visit details on your own server under that code, which carries more and keeps the message clean but needs a server endpoint to build and run.
Will WhatsApp usernames affect this?
They can. Meta is rolling out WhatsApp usernames and a Business Scoped User ID in 2026, which changes how contacts are identified and weakens matching that relies on the phone number. Check Meta’s current documentation on business-scoped user IDs when you build, and do not design around the phone number alone.
Do I need consent for this?
Storing click IDs in a cookie may need visitor consent in some regions, so the capture that feeds this should be consent-aware and wait for the appropriate signal before storing anything. The right setup depends on where your visitors are and the rules that apply.