UTM Parameters for SMS and WhatsApp Campaigns: Tagging Links in Messages
Messaging apps rarely pass a referrer, so untagged SMS and WhatsApp clicks show up as direct traffic. This guide covers the UTM values that work in GA4, how to keep tagged links short enough for a text message, how WhatsApp template buttons handle URL variables, and what to test before you send.
In short
Tag SMS links with utm_medium=sms, which GA4 maps to its SMS channel, and utm_source set to your list or sending tool. For WhatsApp, use a consistent medium such as messaging with utm_source=whatsapp and map it with a custom channel group. Keep links short with a redirect on your own domain, and never put phone numbers in the URL.
Your SMS platform says the campaign link was clicked a few thousand times. GA4 shows a bump in direct traffic and nothing under SMS. That gap is the usual starting point for messaging campaigns. Text messages and WhatsApp chats open links without telling the browser where the click came from, so unless the link itself carries UTM parameters, analytics has no way to credit the message. This guide shows how to tag messaging links without making them too long to send.
Values that GA4 recognises
GA4 has a default SMS channel. It applies when the source or the medium exactly matches sms. That makes SMS one of the simplest channels to set up correctly: put sms in utm_medium and let the source name the list or programme. WhatsApp has no channel of its own in GA4's defaults, so you choose a medium and map it yourself. The difference between the two fields is covered in utm_source vs utm_medium.
| Parameter | SMS | |
|---|---|---|
| utm_source | List or programme, e.g. vip-texts | |
| utm_medium | sms | messaging |
| utm_campaign | Send name, e.g. summer-sale-2026 | Template or broadcast name |
| utm_content | Link position or variant | Button or link label |
| Default GA4 channel | SMS | None: map with a custom channel group |
For WhatsApp, add a Messaging channel to a custom channel group that matches the medium messaging. Google documents that custom channel groups can be applied to reports retroactively, so earlier sends tagged the same way are reclassified too. Before building it, look at where GA4 currently places your WhatsApp sessions, because the source whatsapp may already match one of the default rules, and you want your custom rule to take precedence deliberately rather than by accident.
Choosing the source value
For SMS, the name of your sending tool is a tempting source, but it answers a question you will rarely ask. A source per list or programme, such as vip-texts, back-in-stock or appointment-reminders, lets you compare the messages that actually differ. Keep transactional texts such as delivery updates in their own source so they do not inflate marketing results. For WhatsApp, whatsapp as the source keeps the platform visible, and the campaign and content fields carry the detail. Whatever you choose, write the list of allowed values down and use lower case throughout, because GA4 treats differently capitalised values as separate rows.
Keeping tagged links short enough to send
A standard SMS segment holds 160 characters in the basic GSM character set, and a URL with five UTM parameters can use most of that on its own. Longer messages are split into multiple segments, which usually costs more. The practical answer is a short path on your own domain, such as example.com/s/summer, that redirects to the full tagged URL. The message carries the short link, and your server adds the parameters.
- Use one short path per send or per variant, so results stay separate.
- Prefer your own domain over a generic public shortener, so recipients can see who the link belongs to and the link never depends on a third-party account.
- If your SMS platform shortens links automatically with its own click-tracking domain, send a test and check that the final URL still carries every parameter.
- Make sure the redirect keeps the query string all the way to the landing page.
Our guide to URL shorteners and UTM tracking covers how to test any shortener before you rely on it.
WhatsApp template URL buttons
Business messages sent through the WhatsApp Business Platform use approved templates, and templates can include URL buttons. Meta's documentation describes a URL button as supporting one variable, appended to the end of the URL, with a maximum URL length of 2,000 characters and a limit of two URL buttons per template. That shapes how you tag:
- 1Put the fixed parameters in the button's base URL, for example https://example.com/offer?utm_source=whatsapp&utm_medium=messaging&utm_content=offer-button&utm_campaign=
- 2Use the single variable at the end to fill utm_campaign per send, so one approved template serves many campaigns.
- 3Percent-encode any special characters in the variable value, as Meta's documentation requires.
- 4Alternatively, point the button at a short path on your own domain and pass a campaign code as the variable, letting your redirect add the full tags.
Links typed into the body text of a WhatsApp message are just text, so tag them the same way you would tag an SMS link.
Forwarded messages and other leaks
Messages get forwarded. When someone forwards your WhatsApp message or copies your SMS link to a friend, the tags travel with it, and the friend's visit is credited to your campaign. That usually works in your favour, but it means messaging campaigns can look slightly better than their direct reach. Untagged shares of your website, on the other hand, arrive as direct with no source at all, which is part of the dark social problem and one reason direct traffic is so high in GA4.
Never put phone numbers in the link
Messaging platforms make it easy to personalise links with the recipient's number or name. Do not put either in a URL parameter. Google's Analytics guidance says URL paths and parameters must be free of personally identifiable information, and URLs are stored in browser history and server logs. If you need to tie a click back to a contact, use an opaque ID that only your own systems can resolve.
Reading messaging results in GA4
Open Reports, Acquisition, Traffic acquisition and filter Session default channel group to SMS, or to your custom Messaging channel for WhatsApp. Session campaign compares sends; adding Session manual ad content shows which link or button earned the visit. Your messaging platform's click count will be higher than GA4's sessions. Platforms count every tap, including repeat taps, link previews fetched by some phones, and taps from people who leave before the page loads or who decline analytics consent. A steady ratio between the two is normal. A sudden drop in sessions against the same click volume almost always means a broken link, a changed redirect or a shortener that stopped passing parameters, and is worth checking the same day.
Messaging often produces fast responses, with many clicks arriving soon after a send. If you send at a fixed time, a quick look at hourly sessions for the first few hours is a useful sanity check that the tagged traffic is arriving at all.
A pre-send check
- 1Send the message to a test phone and tap the link.
- 2Confirm the landing page URL shows every parameter after all redirects.
- 3Check GA4 Realtime for the expected source and medium.
- 4For WhatsApp templates, check the variable filled in correctly and is percent-encoded.
The same discipline applies to every owned channel; our guide to UTM parameters for email marketing covers the equivalent setup for newsletters and flows. If you want the messaging source stored against each lead and not only in GA4, EndFrame's first-party tracker captures UTM values on arrival and keeps them on the visitor record through to the form submission.
Frequently asked questions
What utm_medium should I use for SMS?
Use sms, in lower case. GA4's SMS channel is assigned when the source or the medium exactly matches sms. Variants such as text, txt or sms-blast do not match and will usually end up in Unassigned.
Is there a WhatsApp channel in GA4?
No. GA4's default channel group has no messaging or WhatsApp channel. Pick one medium for WhatsApp, such as messaging, and add a channel for it in a custom channel group. Check your reports after the first send to see where GA4 placed the traffic before you build the custom rule.
Why do my SMS clicks show as direct traffic?
Messaging apps generally open links without sending a referrer, so an untagged click looks the same as someone typing your address. The fix is to tag every link, and to check that link shortening or your own site's redirects do not drop the parameters.
Sources
- 1.Collect campaign data with custom URLs - Analytics Help
- 2.Default channel group - Analytics Help
- 3.Custom channel groups - Analytics Help
- 4.Template components - WhatsApp Business Platform - Meta for Developers
- 5.Best practices to avoid sending Personally Identifiable Information (PII) - Analytics Help
Try EndFrame
Add a server-side path for your conversions.
EndFrame collects events first-party and forwards conversions server-side to Meta, GA4, TikTok, and webhooks with event-ID deduplication — then credits each conversion to its campaign, with the visit-to-conversion path you can audit.
No credit card required