Product analytics · 3 min read · Updated 2026-09-21
UTM and attribution
Where someone came from, captured once at the start of the visit and stamped on everything they do next.
You spend money to get people to your app. Attribution is the part that tells you which of that money worked. It is also the part most likely to be quietly wrong, because campaign parameters only exist on the landing URL — and by the time someone actually converts, they are four pages deep and the parameters are long gone.
The problem
Someone clicks your ad and lands on your homepage with the campaign parameters attached:
/?utm_source=google&utm_medium=cpc&utm_campaign=spring-saleThey browse for ten minutes and buy something from /checkout. If you only read the URL at the moment of purchase, that sale came from nowhere. Every conversion gets attributed to “direct”, and the campaign that paid for it gets no credit.
What it is
UTM parameters are five conventional query keys that ad platforms and email tools append to your links:
utm_source— where it came from:google,newsletter.utm_medium— the channel:cpc,email,social.utm_campaign— the specific push:spring-sale.utm_termandutm_content— keyword and creative variant.
There is nothing magic about them. They are a naming convention that everyone agreed to, which is exactly why they are worth using consistently.
First-touch, captured at session start
When a session begins, the SDK parses the five UTM parameters out of the landing URL and stores them alongside the session, together with a sanitized document.referrer. Every analytics event in that session then carries those values — the pageview on the landing page, the add_to_cart ten minutes later, and the order_completed at the end.
Because attribution is tied to the session, it re-captures when the session rotates — after 30 minutes idle or at UTC midnight. A person who comes back tomorrow through a different link starts a new session with that new campaign.
Session starts at /?utm_source=google&utm_medium=cpc&utm_campaign=spring-sale
$pageview / → utmCampaign: spring-sale
product_viewed /products/trail-runner → utmCampaign: spring-sale
add_to_cart /products/trail-runner → utmCampaign: spring-sale
order_completed /checkout → utmCampaign: spring-saleReading the campaigns report
The Overview shows a campaigns table: source, medium, campaign, and the event count for each combination, for the top twelve. A few things to keep in mind when reading it:
- It counts events, not conversions. A campaign that sends chatty users can out-rank one that sends buyers. Pair it with a funnel when you care about outcomes.
- Visits with no UTM parameters at all are simply absent from the table, so it is not a breakdown of all your traffic.
- Case and spelling matter.
Googleandgoogleare two rows forever. Agree on lowercase, and generate your links from a template rather than by hand.
Attribution is first-touch per session, so a row credits the campaign that started the visit. The referrer travels on every event and is shown on the event detail, while the Overview aggregates by campaign — use the event detail when you want the referring page for a single visit.
What gets cleaned on the way in
Ad platforms add more than UTM parameters. Click identifiers such as gclid, fbclid, and msclkid — along with anything that looks like a token, secret, or API key — are replaced before the URL is sent, and redacted again on the server. URL fragments are dropped entirely. The referrer is stored, but it goes through the same cleaning.
Related guides
Product analytics · 3 min
Visitors, sessions, and identifyThree ids doing three different jobs. Get them straight and every number downstream makes sense.
Product analytics · 4 min
What product analytics actually isError tracking tells you what broke. Product analytics tells you what people were trying to do — and how many of them gave up.
Product analytics · 4 min
Funnels and drop-offA funnel tells you which step loses people. Talaria then hands you the people, and the replay of them leaving.