Skip to content

This term

UTM Parameters(UTM)

Tags added to a link's URL, such as utm_source and utm_campaign, so analytics tools credit visits from WhatsApp messages to the right campaign.

Also called: UTM tags · UTM codes · Urchin Tracking Module · Campaign parameters

Often confused with

Webhook Referral Object

Ad details attached to an inbound WhatsApp message sent from a Click-to-WhatsApp ad: source URL, ad ID, headline, media and the ctwa_clid click ID.

Read the Webhook Referral Object entry

Trace a tag from template to analytics

3 / 3
{
"name": "diwali_sale_2026",
"category": "MARKETING",
"language": "en",
"components": [
{ "type": "BODY",
"text": "Our Diwali sale is live. Tap below to see this week's offers." },
{ "type": "BUTTONS",
"buttons": [
{ "type": "URL",
"text": "See offers",
"url": "https://shop.example.in/s?utm_source=whatsapp&utm_medium=template&utm_campaign=diwali_2026_sale&ref={{1}}",
"example": ["https://shop.example.in/s?utm_source=whatsapp&utm_medium=template&utm_campaign=diwali_2026_sale&ref=r7k2p9"] }
] }
]
}

Step 3 of 3 · line 13

The example shows reviewers a real destination, with a sample token in place of the variable.

Jump to
Three snippets: the approved button URL with fixed UTM tags, the send that fills only the last variable, and an ad-started chat where UTM cannot help and the referral object's ctwa_clid does the work.

Template button, step 3 of 3, line 13: The example shows reviewers a real destination, with a sample token in place of the variable.

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?

  1. Step 1

    Agree a naming scheme

    Fix the values once: utm_source=whatsapp; utm_medium naming the touchpoint (template, chat, channel); utm_campaign as a dated slug such as diwali_2026_sale; utm_content for the button or variant. Lower case, underscores, no spaces.

  2. 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}}.

  3. 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.

  4. 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_medium so you can tell them apart.

  5. 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, %26 and %3D and 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_content or ref is 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 referral object on the first inbound message and send its ctwa_clid with 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.

UTM FAQs

Why does WhatsApp traffic show up as direct in Google Analytics?+
Because WhatsApp usually opens links without passing a referrer, so analytics cannot see where the visit came from. Add UTM parameters to every link you send and those sessions are filed under your WhatsApp source and campaign instead.
Can I add UTM parameters to a WhatsApp template button?+
Yes. Put the fixed tags in the approved button URL before the variable, ending with something like `&ref={{1}}`, and send only the per-recipient value. Template URL buttons allow up to 2,000 characters and one variable, which must be at the end.
What utm_source and utm_medium should I use for WhatsApp?+
Use `utm_source=whatsapp` everywhere and let `utm_medium` say which touchpoint it was, such as `template`, `chat` or `channel`. Whatever you choose, the essential part is that every team uses the same lower-case values.
Do UTM parameters work for Click-to-WhatsApp ads?+
Not for the chat itself. The ad opens a conversation rather than a web page, so attribution comes from the `ctwa_clid` and `source_id` in the webhook referral object. UTM tags still work on links you send later in that chat.
Are UTM parameters in WhatsApp links a privacy risk?+
Only if you put personal data in them. Analytics tools and any third-party scripts on the landing page see the full URL, so use opaque tokens rather than phone numbers, names or emails in any tag or variable.

See InfiQ pricing

Try it on the official WhatsApp Business API

InfiQ is an official Meta Business Partner. Start a 7-day free trial — no card needed — and see this running on your own number.