Sub topic 11
Multi-touch paths and attribution models
This chapter explains how to reconstruct the sequence of touchpoints that leads to a purchase and how attribution models split credit among them. It also covers where those models mislead you. It builds on the earlier chapters on touchpoints, funnel metrics, and event tracking.
Prerequisites
This chapter assumes you can do the following:
- Read a funnel table and compute stage-to-stage conversion.
- Name the events your site already sends, such as
page_view,add_to_cart, andpurchase. - Recognize common channels: paid search, organic search, email, social, referral, and direct.
- Read short Python.
Why one purchase has many touches
A journey map shows stages in order. Real customers rarely move through them in a straight line. A shopper might see a social post, search for the brand a week later, read a review site, click a discount email, and then buy after typing your address into the browser. That is five touches, and each one can have contributed to the sale.
A multi-touch path is the ordered list of touchpoints one customer had with you before a conversion. Attribution is the practice of assigning each touch some share of the credit for that conversion. The credit can be a fraction of the order value, or a fraction of one conversion.
Attribution answers a budget question: which channels earn the credit, and so which ones deserve more spend. It does not answer why customers hesitated or what they felt. That is the job of the qualitative layers of the map. Treat the two as complementary.
Building the path from events
An attribution report is only as good as the path behind it. A path comes from the events you instrument. Each event needs at least these fields:
- A customer identifier, such as a first-party cookie ID or a signed-in user ID.
- A timestamp.
- The channel or campaign that brought the visit, usually from UTM parameters or the referrer.
- The event type, so you can tell a visit from a conversion.
The steps to assemble a path are as follows:
- Collect all touches for one identifier.
- Sort them by timestamp.
- Cut off anything older than the lookback window, the maximum age of a touch that can still receive credit. Typical values are 7, 30, or 90 days, and the right value depends on how long your customers take to decide.
- Stop at the conversion. Touches after the purchase belong to the next journey.
- Collapse accidental duplicates, such as a page reload that fires the same campaign touch twice.
The lookback window changes the answer. A 7-day window gives no credit to a social post seen 14 days earlier. A 30-day window does.
Rule-based attribution models
Rule-based models apply a fixed formula to every path. The formula depends only on the position or timing of each touch, not on how well the touch worked.
| Model | Rule | Favors | Typical blind spot |
|---|---|---|---|
| First click | All credit to the first touch | Awareness channels | Ignores everything that closed the sale |
| Last click | All credit to the final touch | Search, email, direct | Ignores everything that created the demand |
| Linear | Equal credit to every touch | Long, varied paths | Treats a trivial touch like a decisive one |
| Time decay | Touches nearer the purchase get more credit | Closing channels | Undervalues slow-burn awareness work |
| Position based | 40% first, 40% last, 20% shared by the middle | Opening and closing touches | The 40/20/40 split is arbitrary |
No model is correct in an absolute sense. Each one encodes an opinion about which part of the journey matters. Comparing several models side by side shows how sensitive a channel's value is to that opinion.
A worked example in Python
The function below applies five rule-based models to the path from the diagram. It gives the order a value of 100 so the credit reads as a percentage.
from collections import defaultdict
def attribute(path, model, value=100.0, half_life_days=7.0):
"""path: list of (channel, days_before_purchase), oldest touch first."""
n = len(path)
if model == "first_click":
weights = [1.0] + [0.0] * (n - 1)
elif model == "last_click":
weights = [0.0] * (n - 1) + [1.0]
elif model == "linear":
weights = [1.0 / n] * n
elif model == "time_decay":
raw = [0.5 ** (days / half_life_days) for _, days in path]
total = sum(raw)
weights = [w / total for w in raw]
elif model == "position_based":
if n == 1:
weights = [1.0]
elif n == 2:
weights = [0.5, 0.5]
else:
weights = [0.4] + [0.2 / (n - 2)] * (n - 2) + [0.4]
else:
raise ValueError(f"unknown model: {model}")
credit = defaultdict(float)
for (channel, _), weight in zip(path, weights):
credit[channel] += weight * value
return {channel: round(v, 1) for channel, v in credit.items()}
path = [
("social", 14),
("review_site", 9),
("email", 2),
("paid_search", 0),
]
for model in ["first_click", "last_click", "linear", "time_decay", "position_based"]:
print(model, attribute(path, model))
# Output:
# first_click {'social': 100.0}
# last_click {'paid_search': 100.0}
# linear {'social': 25.0, 'review_site': 25.0, 'email': 25.0, 'paid_search': 25.0}
# time_decay {'social': 10.1, 'review_site': 16.5, 'email': 33.1, 'paid_search': 40.3}
# position_based {'social': 40.0, 'review_site': 10.0, 'email': 10.0, 'paid_search': 40.0}Notice three details in the code:
- The weights always sum to 1, so the credit across channels equals the order value. A model whose credit does not sum to the order value double counts revenue.
- Credit is added per channel, so a channel that appears twice in a path gets the sum of its touches.
- Time decay uses a half-life. A touch
half_life_daysbefore the purchase counts half as much as a touch on the day of purchase.
Under last click, social media receives nothing, and a manager reading that report might cut its budget. Under first click, paid search receives nothing, and it looks useless. Both readings are incomplete, because the path needed both.
Data-driven models
Data-driven attribution (DDA) uses a statistical model instead of a fixed formula. It compares paths that converted with similar paths that did not, then estimates how much each channel changed the chance of conversion. Common techniques include Shapley values and Markov chain removal effects. Removal effect asks how much the overall conversion rate drops if a channel is taken out of all paths.
DDA reflects your actual customers, but it has costs:
- It needs enough conversions to be stable. A store with a few dozen sales a month will get noisy credit.
- It needs non-converting paths too, which means you must keep tracking visitors who never bought.
- It is harder to explain. A rule such as "last click" can be audited by hand, but a model's weights usually cannot.
- Its inputs are still observed touches. If a touch was never recorded, no model can credit it.
Where attribution misleads
Attribution looks like measurement, but it is an estimate built on partial data. The common failure modes are these:
- Broken identity. The same person on a phone and a laptop looks like two customers. The phone path ends with no purchase, and the laptop path has one touch, usually direct. This inflates direct and last-click channels.
- Missing touches. Ad blockers, consent refusals, and private browsing remove touches. Word of mouth, podcasts, and messages shared in private chats appear as direct traffic. This is sometimes called dark social.
- Correlation taken as causation. Branded search and retargeting reach people who were already about to buy. They collect credit under last click and time decay without creating the sale.
- View-through credit. Some ad platforms credit a conversion when someone merely saw an ad. Platforms also report their own conversions, so the totals across platforms often exceed your real order count.
- Window cutoffs. A short lookback window drops long consideration periods, which is common for expensive or high-risk products.
- Survivorship. Looking only at converting paths hides channels that bring many visitors who never buy.
Choosing a model for your map
Pick the model according to the question you are answering:
- To judge which channels open journeys, start with first click or position based.
- To judge which channels close journeys, use last click or time decay.
- To judge the whole path, use linear or position based as a baseline, and use DDA only when you have enough conversions.
- To test whether a channel causes sales, use a holdout or geo experiment, where you turn the channel off for a random group and compare outcomes. Attribution alone cannot prove causation.
Whichever model you choose, write it down on the map and in the report. The same channel can look good or bad depending on the model, so readers need to know which one produced the numbers.
Connecting attribution back to the map
Attribution adds numbers to the touchpoint layer of your map:
- Mark which touchpoints appear most often in converting paths.
- Compare the typical converting path with the typical non-converting path, and look for steps that only the converters took.
- Check path length and elapsed time. If most buyers need three touches over two weeks, a stage you assumed was short may be long.
- Treat surprises as hypotheses for the friction analysis chapter, not as conclusions. A heavily used review site raises the question of what customers were looking for there.
Exercise
A customer's path is: organic search (10 days before purchase), email (3 days before), paid search (0 days before). The order is worth 60. Using the position-based rule (40% first, 40% last, 20% split among the middle touches), how much credit does each channel get? Then name one reason the last-click report for this customer would mislead a budget decision.
Show answer
Organic search gets 24 (40% of 60), email gets 12 (20% of 60, the only middle touch), and paid search gets 24 (40% of 60). The total is 60. Last click gives all 60 to paid search, which hides that organic search started the journey and email moved it forward. Paid search may only have captured a customer who was already going to buy, so cutting organic or email spend based on that report could reduce future sales.
Exercise
Your 7-day lookback window shows that social media almost never appears in converting paths. A colleague says to cut the social budget. What would you check before agreeing?
Show answer
Check whether the window is too short for your customers' decision time. Rerun the report with a 30-day or 90-day window and compare. Also check how many social visitors were later seen under a different identifier (for example, on another device), and whether a holdout test shows a drop in sales when social is paused. If the credit appears only with a longer window, the original report was cutting off social's early touches.