Sub topic 13
Tracking links and attribution models
This chapter assumes you know the funnel stages, the owned, paid, and earned channel split, and the core metrics (CTR, CPC, CPA, ROAS, conversion rate). Here you will tag links so each visit can be traced to a source, then see why different attribution models split credit differently.
Why tag links at all
Analytics tools often group traffic into broad buckets such as "direct" or "referral." Email clicks opened in a mobile app, or links in a PDF, frequently arrive with no referrer and land in "direct." Tagging a link states its source explicitly, so the report no longer has to guess.
UTM parameters
UTM parameters are labels added to the end of a URL after a ?. Analytics tools read them when the visitor lands and store them with the session.
https://example.com/spring-sale?utm_source=newsletter&utm_medium=email&utm_campaign=spring_sale&utm_content=header_button| Parameter | Answers the question | Example value |
|---|---|---|
| `utm_source` | Which site, list, or platform sent the visit? | `newsletter` |
| `utm_medium` | Which channel type is it? | `email` |
| `utm_campaign` | Which campaign is it part of? | `spring_sale` |
| `utm_content` | Which link or creative was clicked? | `header_button` |
utm_term also exists. It is mainly used to record the paid search keyword.
Naming rules that prevent messy reports
UTM values are plain text, and analytics tools treat Email, email, and e-mail as three different mediums. Agree on a convention and keep it in a shared sheet.
- Use lowercase only.
- Use underscores instead of spaces.
- Keep a fixed list of allowed
utm_mediumvalues, such asemail,cpc,social,affiliate. - Do not put personal data such as email addresses in any parameter.
From last click to full path
A buyer rarely converts on the first visit. A typical path might be a search ad, then a social post, then an email, then a purchase. An attribution model is a rule for dividing credit for the conversion among those touchpoints.
Common attribution models
| Model | How credit is assigned | Tends to favor |
|---|---|---|
| Last click | 100% to the final touchpoint | Bottom-funnel channels such as paid search and email |
| First click | 100% to the first touchpoint | Discovery channels such as display, social, and SEO |
| Linear | Equal share to every touchpoint | Long paths with many channels |
| Time decay | More credit to touchpoints nearer the sale | Short sales cycles |
| Position-based | Large shares to first and last, small share to the middle | Balanced views of discovery and closing |
| Data-driven | Credit estimated from observed paths by an algorithm | Accounts with enough conversion volume |
A worked comparison
Take the path in the diagram and a sale worth 100. Last click gives email all 100. First click gives paid search all 100. Linear gives each of the four steps 25 (the purchase itself is not a touchpoint, so the three channels get 33.3 each). The sale is identical, yet the same email campaign looks either excellent or irrelevant, depending on the model.
def linear_credit(path, revenue):
share = revenue / len(path)
return {channel: round(share, 2) for channel in path}
print(linear_credit(["paid_search", "organic_social", "email"], 100))This prints {'paid_search': 33.33, 'organic_social': 33.33, 'email': 33.33}.
Common errors
- Comparing channels in reports that use different models, such as an ad platform's own numbers against your analytics tool.
- Judging awareness channels only by last-click results, which undervalues them.
- Treating any model as truth. Each is a convention. Cookie limits, privacy settings, and cross-device use mean some touchpoints are never seen.
- Inconsistent tagging, which splits one channel across several rows.
Exercise
A visitor clicks a display ad, later clicks a paid search ad, and finally buys after clicking an email. Which channel gets full credit under first-click and which under last-click attribution? Why might a team that uses only last click cut the display budget?
Show answer
First click credits display. Last click credits email. Under last click, display receives no credit even though it started the journey, so its reported ROAS looks like zero and cutting it seems justified. That cut could shrink the pool of people who later search and open emails.
Exercise
Your report shows separate rows for utm_medium=Email, email, and e-mail. What went wrong, and what is the fix?
Show answer
UTM values are case-sensitive, free-text labels, so each spelling was recorded as its own medium. The fix is a written naming convention: lowercase, a fixed list of allowed values, and a shared tracking sheet used for building every link.