UTM and campaigns
How UTM parameters, ref links and ad click ids map to sources, channels and campaigns.
Parameters Trakily reads
| Parameter | Used for |
|---|---|
utm_source | The source (referrer) of the visit. Falls back to ref if utm_source is missing. |
ref | Same as utm_source, for links like example.com/?ref=newsletter. |
utm_medium | Decides the channel: cpc, paid, display and similar mean Paid; email or newsletter mean Email. |
utm_campaign | The Campaign tab of the Sources card. |
utm_term | Stored with the visit (used for Meta Ads matching). |
utm_content | Stored with the visit (used for Meta Ads matching). |
- Parameter
utm_source- Used for
- The source (referrer) of the visit. Falls back to ref if utm_source is missing.
- Parameter
ref- Used for
- Same as utm_source, for links like example.com/?ref=newsletter.
- Parameter
utm_medium- Used for
- Decides the channel: cpc, paid, display and similar mean Paid; email or newsletter mean Email.
- Parameter
utm_campaign- Used for
- The Campaign tab of the Sources card.
- Parameter
utm_term- Used for
- Stored with the visit (used for Meta Ads matching).
- Parameter
utm_content- Used for
- Stored with the visit (used for Meta Ads matching).
Source, campaign and channel belong to the session and come from its first pageview, so they stay correct as the visitor clicks around.
Common short sources are recognised, so utm_source=x or twitter counts as X, fb as Facebook, ig as Instagram and hn as Hacker News.
How channels are assigned
Each session gets one channel. The rules run in this order and the first match wins:
| Channel | When |
|---|---|
| Paid | An ad click id is present (see below), or utm_medium is cpc, ppc, cpm, cpv, paid, paid_social, paid_search, display, ad, ads or retargeting. |
| utm_medium is email, e-mail or newsletter, or the referrer is a webmail site (Gmail, Outlook, Yahoo Mail). | |
| Organic Search | The source is a search engine: Google, Bing, DuckDuckGo, Yahoo, Ecosia, Yandex, Baidu, Brave Search. |
| Social | The source is a social site: X, Facebook, Instagram, LinkedIn, Reddit, YouTube, Hacker News, Product Hunt, TikTok, Pinterest, Threads, Bluesky, Indie Hackers. |
| AI / LLM | The source is an AI assistant: ChatGPT, Perplexity, Claude, Gemini, Copilot, Meta AI, DeepSeek, Mistral, You.com. |
| Referral | Any other referrer or utm_source. |
| Direct | No referrer and no source. |
- Channel
- Paid
- When
- An ad click id is present (see below), or utm_medium is cpc, ppc, cpm, cpv, paid, paid_social, paid_search, display, ad, ads or retargeting.
- Channel
- When
- utm_medium is email, e-mail or newsletter, or the referrer is a webmail site (Gmail, Outlook, Yahoo Mail).
- Channel
- Organic Search
- When
- The source is a search engine: Google, Bing, DuckDuckGo, Yahoo, Ecosia, Yandex, Baidu, Brave Search.
- Channel
- Social
- When
- The source is a social site: X, Facebook, Instagram, LinkedIn, Reddit, YouTube, Hacker News, Product Hunt, TikTok, Pinterest, Threads, Bluesky, Indie Hackers.
- Channel
- AI / LLM
- When
- The source is an AI assistant: ChatGPT, Perplexity, Claude, Gemini, Copilot, Meta AI, DeepSeek, Mistral, You.com.
- Channel
- Referral
- When
- Any other referrer or utm_source.
- Channel
- Direct
- When
- No referrer and no source.
Visits from your own domain and its subdomains are not counted as a referrer.
Ad click ids
The script also records these click ids from the landing URL. Any of them marks the session as Paid:
gclid gclsrc wbraid gbraid fbclid msclkid ttclid twclid li_fat_id
UTM parameters and click ids are removed from the stored page URL, so your Pages report isn't split into hundreds of variants.
Tagging links
A consistent scheme makes the Campaign tab useful. For example:
https://example.com/?utm_source=newsletter&utm_medium=email&utm_campaign=2026-10-launch https://example.com/?utm_source=youtube&utm_medium=video&utm_campaign=onboarding-demo https://example.com/?ref=producthunt
- Use lowercase and pick one spelling per source.
- Only set
utm_medium=cpc(or another paid value) on links you pay for, so organic posts stay in Social. - Never tag internal links on your own site: a new UTM on an internal link would not change the session, but it clutters your URLs.
The guide UTM tagging for X, newsletters and YouTube has ready-made patterns.