What is UTM parameters?
UTM parameters (Urchin Tracking Module parameters) are key-value pairs added to the query string of a link so web analytics can tell which campaign sent a visitor. The five standard keys are utm_source (where the traffic came from, such as whatsapp), utm_medium (the kind of channel, such as template or chat), utm_campaign (the campaign name), utm_content (which link, button or variant) and utm_term (originally the paid-search keyword). Google Analytics 4 also reads utm_id and a few newer keys.
On WhatsApp, UTM tags go on links people tap to leave the chat: the URL in a template's call-to-action button, links in a template body or a free-form reply, and links in a channel post. The tagged link travels unchanged; when the browser opens it, the analytics script on the landing page reads the tags and files the session under that source, medium and campaign. This matters more on WhatsApp than on most channels, because the app usually passes no referrer, so an untagged visit looks as if someone typed the address.
UTM tags measure web clicks, not conversations. When a Click-to-WhatsApp ad opens a chat there is no web visit to tag; the ad is identified instead by the referral object on the first inbound message, which carries the ad's source_id and a ctwa_clid click ID that Conversions API events can be tied to. Attribution is the wider practice of joining these signals, together with order data, into one view of what each campaign earned.
Key takeaways
- UTM parameters are query-string tags (utm_source, utm_medium, utm_campaign, utm_content, utm_term) that tell analytics where a visit came from.
- Links opened from WhatsApp usually arrive without a referrer, so untagged clicks are reported as direct traffic.
- In a template, put the fixed UTM tags in the approved URL and keep the button's one variable as the last part of the link.
- UTM tags track clicks that leave WhatsApp for a website; chats started from an ad are attributed with the ctwa_clid in the webhook referral object.
- Tag values are case-sensitive in most analytics tools, so agree on one lower-case scheme and generate links from it in code.
UTM parameters: key facts and limits
- Standard keys
- utm_source, utm_medium, utm_campaign, utm_content, utm_term
- Also read by GA4
- utm_id, utm_source_platform, utm_creative_format, utm_marketing_tactic
- Template URL button
- Up to 2,000 characters, one variable, at the end
- URL buttons per template
- Up to 2
- Case sensitivity
- WhatsApp and whatsapp are reported as different sources
- Chats from Click-to-WhatsApp ads
- Attributed by ctwa_clid in the referral object, not UTM
How does UTM parameters work?
- Step 1
Agree a naming scheme
Fix the values once:
utm_source=whatsapp;utm_mediumnaming the touchpoint (template,chat,channel);utm_campaignas a dated slug such asdiwali_2026_sale;utm_contentfor the button or variant. Lower case, underscores, no spaces. - Step 2
Put fixed tags in the template URL
For a URL button, the approved URL holds the page and the fixed tags, and the one allowed variable goes at the very end:
https://shop.example.in/s?utm_source=whatsapp&utm_medium=template&utm_campaign=diwali_2026_sale&ref={{1}}. - Step 3
Send only the per-recipient suffix
In the send request's button component, the parameter fills
{{1}}: a short opaque token, not a phone number or email. Percent-encode that value only; encoding the whole suffix turns&and=into codes and breaks the tags. - Step 4
Tag chat and channel links in code
Free-form replies, bot messages and channel posts are not reviewed templates, so generate their links with one helper that applies the same scheme, with a different
utm_mediumso you can tell them apart. - Step 5
Test the landing and the report
Open each link once on a phone, confirm the session appears under the right source and campaign in real-time reports, and make sure redirects and link shorteners keep the query string.
UTM parameters in code
// One helper so every WhatsApp link follows the same UTM scheme.const MEDIUMS = ["template", "chat", "channel"];const slug = (v) => String(v).trim().toLowerCase().replace(/[^a-z0-9]+/g, "_");export function tagLink(url, { medium, campaign, content }) {if (!MEDIUMS.includes(medium)) throw new Error("unknown utm_medium: " + medium);const u = new URL(url);u.searchParams.set("utm_source", "whatsapp");u.searchParams.set("utm_medium", medium);u.searchParams.set("utm_campaign", slug(campaign));if (content) u.searchParams.set("utm_content", slug(content));return u.toString();}tagLink("https://shop.example.in/sarees/banarasi", {medium: "chat", campaign: "Diwali 2026 Sale", content: "Agent reply",});// https://shop.example.in/sarees/banarasi?utm_source=whatsapp&utm_medium=chat// &utm_campaign=diwali_2026_sale&utm_content=agent_reply
Generate links for chats, bots and channel posts from one helper, so values never drift between teams.
Common mix-ups
Common mistakes with UTM parameters
Leaving WhatsApp links untagged
With no referrer and no tags, WhatsApp clicks land in direct traffic and the channel looks weaker than it is. Tag every outbound link, including the ones agents paste into chats.
Inconsistent values
whatsapp, WhatsApp, wa and WA-broadcast split one channel into four rows. Keep an allowed-values list and build links from it in code rather than typing tags by hand.
Encoding the whole suffix
If the button variable carries
?utm_source=...&utm_campaign=...and you percent-encode it, the separators become%3F,%26and%3Dand analytics sees no tags. Put fixed tags in the approved URL and encode only the token.Putting personal data in the URL
A phone number or email in
utm_contentorrefis visible to analytics and to every third-party script on the landing page. Use opaque tokens and keep the mapping in your own database.Expecting UTM to track ad chats
A Click-to-WhatsApp ad opens a conversation, not a web page, so there is nothing to tag. Read the
referralobject on the first inbound message and send itsctwa_clidwith your Conversions API events.
Example: Finally crediting a Diwali broadcast
A Jaipur handicrafts store's Diwali broadcast last year showed up only as a spike in direct traffic. This year its marketing template has two URL buttons whose approved URLs carry utm_source=whatsapp&utm_medium=template&utm_campaign=diwali_2026_sale, one with utm_content=btn_new_arrivals and the other with utm_content=btn_gifts, each ending in a ref variable filled with a per-recipient token. Analytics now shows 4,100 sessions and 260 orders from the campaign, with the gifts button driving two-thirds of the revenue, so the reminder two days later leads with gifts. Because the ref token is saved on each order, the team can also see which segment of the broadcast bought.
Rules of thumb
Best practices for UTM parameters
- Keep a shared list of allowed source, medium and campaign values, and reject anything else in your link helper.
- Use utm_content to tell buttons and A/B variants apart within one campaign.
- Test every link on a real phone; some redirects and shorteners drop the query string.
- Save the ref token on the order record so web orders join back to the exact send, not just the campaign.
Why the difference matters
Why does UTM parameters matter?
Without UTM tags, WhatsApp's contribution is invisible in web analytics: a broadcast that drove thousands of visits and hundreds of orders shows up as an unexplained bump in direct traffic that nobody credits to it. With a consistent scheme, every template, button and variant becomes its own row next to email, search and ads, so marketers can compare cost per order across channels and developers can join web orders back to the exact WhatsApp send that produced them.