Sub topic 9
Attribution: giving credit to channels
This chapter assumes you can read a UTM-tagged URL, know the funnel stages (awareness, leads, sales, retention), and can run short Python scripts. Earlier chapters covered tracking and sales metrics. This one covers how to split credit for a sale among the channels that touched the buyer.
What attribution answers
A customer rarely buys after one visit. A typical B2B buyer might see a social post, read a blog article found through organic search, and click a newsletter link before booking a demo. Each of those events is a touchpoint, a recorded interaction between a person and your marketing. The sequence of touchpoints before a conversion is the journey.
Attribution is the set of rules that assigns a share of the conversion, usually revenue or a lead, to each touchpoint's channel. It exists to guide budget decisions: which channels to fund, which to cut, and which to investigate.
Attribution does not prove that a channel caused a sale. It distributes credit by a rule. Whether the sale would have happened anyway is a different question, covered under incrementality in the experimentation chapter.
What attribution needs
Attribution only works on data you collected earlier in the pipeline.
- Consistent tagging. Every campaign link needs
utm_source,utm_medium, andutm_campaign, spelled the same way each time.Email,email, ande-mailare three channels to your reports. - A stable identifier. Touches must be linked to one person, through a cookie, a logged-in user ID, or a CRM contact record. If touches cannot be joined, each journey looks like a single visit.
- A conversion event with value. A purchase, a qualified lead, or a closed deal, with an amount if you want revenue credit.
- A lookback window. The number of days before a conversion in which a touch can still earn credit, such as 30 or 90 days. A longer window credits more early touches. A shorter window favors channels close to the sale.
Single-touch models
Single-touch models give all the credit to one touchpoint.
First-touch
First-touch gives 100% of the credit to the first recorded touchpoint. It answers "what brings new people in?" It favors top-of-funnel channels such as social, display, and content. It ignores everything that happened afterward, so it can overrate channels that attract browsers who never buy.
Last-touch
Last-touch gives 100% of the credit to the final touchpoint before conversion. It is easy to compute, and it is the default in many tools. It favors bottom-of-funnel channels such as branded search, email, and direct traffic. These channels often collect demand that other channels created, so last-touch tends to undervalue awareness work.
Last-touch also has a known trap with direct traffic. When someone types your URL or uses a bookmark, there is no referrer. The visit is labeled "direct" and takes the credit, even if an ad prompted it a day earlier.
Multi-touch models
Multi-touch models split credit across several touches in a journey.
| Model | Rule | Favors | Main weakness |
|---|---|---|---|
| Linear | Equal share to every touch | Long journeys, mid-funnel channels | Treats a passing impression like a decisive visit |
| Position-based (U-shaped) | 40% first, 40% last, 20% split among the middle | Channels that open and close | The 40/20/40 split is a convention, not a measurement |
| Time decay | More credit to touches closer to the conversion | Long sales cycles with late-stage nudges | Undervalues the touch that started the journey |
| Data-driven | A statistical model estimates each touch's contribution from converting and non-converting journeys | Accounts with enough data | Needs volume, is hard to audit, and varies by vendor |
Data-driven models sound objective, but they still learn from correlations in tracked data. If your tracking misses a channel, no model can credit it.
Computing the models
This script applies four rules to three journeys. Each journey is a list of channels in order, paired with the revenue it produced. Credit is allocated in whole currency units so totals can be checked: every model must distribute exactly 600.
from collections import defaultdict
journeys = [
(["social", "organic", "email"], 300),
(["paid_search", "email"], 100),
(["organic"], 200),
]
def weights(model, n):
"""Return the credit share for each of n touches, in order."""
if model == "first_touch":
return [1.0] + [0.0] * (n - 1)
if model == "last_touch":
return [0.0] * (n - 1) + [1.0]
if model == "linear":
return [1.0 / n] * n
if model == "position_based":
if n == 1:
return [1.0]
if n == 2:
return [0.5, 0.5]
return [0.4] + [0.2 / (n - 2)] * (n - 2) + [0.4]
raise ValueError(f"unknown model: {model}")
def attribute(model):
credit = defaultdict(float)
for touches, revenue in journeys:
for channel, share in zip(touches, weights(model, len(touches))):
credit[channel] += revenue * share
return credit
for model in ["first_touch", "last_touch", "linear", "position_based"]:
credit = attribute(model)
parts = ", ".join(f"{ch}={v:.0f}" for ch, v in sorted(credit.items()) if v > 0)
print(f"{model}: {parts}")
# Output:
# first_touch: organic=200, paid_search=100, social=300
# last_touch: email=400, organic=200
# linear: email=150, organic=300, paid_search=50, social=100
# position_based: email=170, organic=260, paid_search=50, social=120Email earns 400 under last-touch but 150 under linear. Social earns 300 under first-touch and nothing under last-touch. The revenue is identical in every run, and only the rule changed. A channel's performance depends on the model you use to measure it.
Choosing a model
No model is correct. Choose by the decision you need to make, and say which model a report uses.
- Deciding where to find new customers: first-touch shows which channels start journeys.
- Deciding what to retarget or close with: last-touch shows which channels finish them.
- Reviewing a mix across a long sales cycle: position-based or linear, because they surface the middle.
- High volume and a mature setup: data-driven, compared against a simple model as a sanity check.
A practical habit is to report two models side by side. A channel that looks strong under both is a safer bet. A channel that wins under only one model needs a closer look.
Gotchas and failure modes
Platform self-reporting double counts
Ad platforms usually report conversions with their own attribution rules and windows, such as a click-through or view-through window. If a buyer saw a social ad, clicked a search ad, and then bought, both platforms may claim the full sale. Add up the platform reports and you can get more conversions than your order system recorded. Use your own analytics or CRM as the single source of truth, and treat platform numbers as channel-level diagnostics.
Cross-device and cookie gaps
If someone sees an ad on a phone and buys on a laptop, a cookie-based tool sees two people. The ad touch is lost, and the purchase may be labeled direct. Browser privacy features and consent choices also remove touches. Logged-in IDs and CRM-matched records reduce the problem but do not remove it.
Offline and untracked touches
Podcasts, events, word of mouth, and sales calls often leave no tagged click. Models cannot credit what they never saw. Common workarounds are a "How did you hear about us?" field on forms and tracking branded search volume as a proxy for awareness.
Lookback windows change the answer
A 7-day window and a 90-day window can rank channels differently from the same data. Choose the window to match your typical sales cycle. Keep it fixed when you compare periods, or the trend will reflect the window change instead of performance.
Credit follows the model, not the money
A channel can receive credit and still be a poor investment. Attribution gives a revenue share. To judge a channel, divide its spend by its attributed customers to get channel-level CAC, and compare that with LTV, as covered in the unit economics chapter.
A short workflow
- Confirm UTM tagging is consistent and the conversion event carries a value.
- Export touchpoints joined to a person ID, ordered by time, within your lookback window.
- Run at least first-touch and last-touch, plus one multi-touch model.
- Check that each model's credited total equals actual revenue.
- Compare channel rankings across models and note large disagreements.
- For any budget change based on a disagreement, plan a test before acting, since attribution alone cannot show causation.
Exercise
A journey has touches [paid_search, social, email, direct] and produces 1,000 in revenue. Using the position-based rule from this chapter (40% first, 40% last, 20% split evenly among the middle touches), how much credit does each channel receive? Which channel would last-touch credit instead, and why might that be misleading here?
Show answer
Position-based gives paid_search 400 (first), social 100 and email 100 (the middle 20% split in two), and direct 400 (last). The total is 1,000. Last-touch gives all 1,000 to direct. That is misleading because direct traffic has no referrer. The visit probably came after the earlier touches, such as the paid search click and the email, so direct is collecting credit for demand those channels created.
Exercise
Your Facebook Ads report shows 120 purchases, Google Ads shows 150, and your order system recorded 210 purchases from paid campaigns in the same period. What is the most likely explanation, and what should you use as the source of truth?
Show answer
The platforms overlap. Each credits purchases that the other also touched, using its own attribution rules and windows, so their sum (270) exceeds actual orders (210). Use the order system or CRM as the source of truth, and treat each platform's figure as a view of its own channel only.
Exercise
A channel earns 25% of revenue under first-touch but only 3% under last-touch. What role does it likely play, and what is a risk of cutting it based on last-touch alone?
Show answer
It likely opens journeys, introducing people who later convert through other channels. Cutting it based on last-touch alone could shrink the pool of new prospects, so the closing channels would see fewer conversions weeks later. Confirm with a test, such as the incrementality methods in the next chapters, before cutting.