webtracking.org

Attribution Models — Definitions & Algorithms

version 1.0.0 · status stable · updated 2026-06-07

Attribution is where most measurement arguments actually live. The disagreements are rarely about data collection — they are about which touchpoint gets credit for a conversion. This page is the canonical reference behind the free Attribution Simulator: every model is defined precisely, with the algorithm written out so you can reproduce a vendor’s numbers (or audit why two tools disagree). It is intentionally implementation-agnostic — GA4, Adobe Analytics Attribution IQ, Customer Journey Analytics, and home-grown BigQuery/Polars pipelines all map onto it.

Notation

A path is the ordered list of marketing touchpoints (channels) a converting — or non-converting — user was exposed to: journey = [c₁, c₂, …, cₙ], conversion at time t_conv. A model is a function that distributes a conversion’s value V across the touchpoints so the weights sum to 1.

1. Rule-based (heuristic) models

These assign credit by position or recency with a fixed rule. They are cheap, deterministic, and explainable — and systematically wrong in ways you should understand.

ModelCredit ruleBias it introduces
Last interaction (last click)100% to cₙOver-credits bottom-funnel / brand & direct.
Last non-direct click100% to the last non-direct touch (GA4’s old default for some reports)Hides true direct demand; over-credits the last paid/earned touch.
First interaction (first click)100% to c₁Over-credits top-funnel / prospecting.
Linear1/n to every touchTreats a throwaway impression like a high-intent click.
Time-decayexponential weight by recency (below)Under-credits early discovery channels.
Position-based (U-shaped)40% c₁, 40% cₙ, remaining 20% split evenly across the middleArbitrary 40/40/20 split; collapses with 1–2 touches.
Participation / linear-any-touchfull credit (1.0) to every touch (weights do not sum to 1)Double-counts on purpose; for reach analysis only, never for budgeting.

Time-decay, written out

Give each touch a weight that halves every H days before the conversion (the half-life; GA4 historically used 7 days, Adobe lets you set it):

wᵢ_raw = 2 ^ ( -(t_conv - tᵢ) / H )
wᵢ     = wᵢ_raw / Σⱼ wⱼ_raw        # normalize so weights sum to 1
creditᵢ = V · wᵢ

Position-based, written out

if n == 1:  credit = [1.0]
if n == 2:  credit = [0.5, 0.5]
else:       credit = [0.40, 0.20/(n-2), …, 0.20/(n-2), 0.40]   # first, middles…, last

Implementation note. “Last non-direct” requires a lookback window and a definition of direct. GA4 and Adobe both treat direct as a fallback channel; if you replicate this in SQL, exclude direct only when another channel exists in the window, otherwise direct keeps the credit.

2. Data-driven models

Rule-based models ignore the data. Data-driven models estimate each channel’s actual contribution from the full set of converting and non-converting paths. Two methods dominate; both are what vendors mean by “algorithmic” / “data-driven” attribution.

2.1 Markov chains — the removal effect

Model the customer journey as a first-order Markov chain. States are the channels plus three special states: (start), (conversion), (null) (dropped off without converting).

Step 1 — transition matrix. From all observed paths, estimate P(sⱼ | sᵢ) = the share of transitions out of state sᵢ that go to sⱼ.

Step 2 — baseline conversion probability. π = probability of reaching (conversion) starting from (start), computed by walking the chain (absorbing-Markov-chain solve, or Monte-Carlo simulation of many random walks).

Step 3 — removal effect. For each channel c, remove it: redirect every transition into c straight to (null). Recompute the conversion probability π_(−c). The removal effect is the relative drop:

removal_effect(c) = (π − π_(−c)) / π

Step 4 — allocate credit in proportion to removal effects:

creditᵢ = total_conversions ·  removal_effect(cᵢ) / Σⱼ removal_effect(cⱼ)

Intuition: a channel that, when deleted, craters total conversions was load-bearing — it earns more credit. This is the method in the ChannelAttribution literature and most open-source MTA. It naturally handles loops and order, and it uses non-converting paths (rule-based models throw those away). Cost: you need enough path volume for stable transition estimates.

2.2 Shapley value — cooperative game theory

Treat each set of channels as a “coalition” and ask: how much does adding channel i to a coalition raise the conversion outcome, averaged over every possible ordering? The characteristic function this standard specifies is the subset-closure form: v(S) = the total value (e.g. conversions) of paths whose channel set is a subset of S — i.e. the conversions coalition S could have produced on its own, with no help from channels outside S. (Two other readings exist in the wild — “paths whose set is exactly S” and “paths touching any channel in S” — and they produce different Shapley numbers; conformance requires the subset-closure form, which is monotone and makes v(N) equal total conversions so credits sum correctly.) The Shapley value of channel i over the set of all channels N is:

φᵢ = Σ_{S ⊆ N\{i}}  [ |S|! · (|N| − |S| − 1)! / |N|! ] · ( v(S ∪ {i}) − v(S) )

v(S ∪ {i}) − v(S) is i’s marginal contribution to coalition S; the factorial term is the probability of that coalition forming in a random ordering. Shapley credit is the unique allocation that is efficient (credits sum to the total), symmetric (equal channels get equal credit), and dummy-free (a channel that never adds value gets zero). Google’s data-driven attribution is Shapley-based in spirit; Adobe’s “Algorithmic” model in Attribution IQ uses a Harsanyi-dividend / Shapley approach. Cost: the coalition count is 2^k for k channels — collapse rare channels into an other bucket and you keep it tractable.

Markov vs Shapley, practically: Markov is order-aware and scales to many channels via simulation; Shapley is order-agnostic, axiomatically “fair”, and explodes combinatorially. For 6–10 channels, run both in the simulator and reconcile — large gaps usually mean a low-volume channel or a tracking gap, not a modeling bug.

3. How the major platforms implement this

Treat the specifics below as a map, not gospel — vendors change defaults and deprecate models, so verify against current product docs before you quote a number to a stakeholder.

  • GA4 — Default reporting attribution is data-driven (DDA); rule-based cross-channel models (first/last/linear/position/time-decay) remain selectable in some surfaces, and Google has been deprecating the older rule-based models over time. Conversion credit is computed on Google / cross-channel paths and is subject to lookback windows. The Attribution reports and the Model-comparison tool are where you compare allocations.
  • Adobe Analytics — Attribution IQ (in Analysis Workspace) — rule-based models on any eVar / dimension: First/Last Touch, Linear, Participation, Same-Touch, U-Shaped, J-Curve, Inverse-J, Time-Decay, plus Algorithmic (Shapley-based). Models are applied per-metric, per-dimension at query time — extremely flexible, but credit is computed within Adobe’s visit/visitor and lookback rules.
  • Customer Journey Analytics (CJA) — Attribution IQ across stitched cross-channel data (online + offline), with configurable lookback and the same model set, computed over the dataset’s Person ID rather than a single property’s visitor.
  • Warehouse / DIY (BigQuery, Snowflake, Polars) — you own the path-building SQL and the model. This is where Markov/Shapley actually get run at scale; the GA4 BigQuery export (events_* → sessionized paths) is the usual input. The Simulator mirrors this so you can prototype before writing the pipeline.

4. Conformance — what “implements this standard” means

A tool or pipeline conforms if it: (a) labels each model by the names above; (b) for rule-based models, produces weights that match the formulas in §1; (c) for data-driven models, documents whether it uses Markov removal-effect or Shapley and exposes the lookback window and the channel set; and (d) states explicitly when credits do not sum to 1 (participation/any-touch).

5. Choosing a model (the honest version)

  • Don’t agonize early. Linear or position-based is fine until you have real multi-touch path volume — the data quality of your touchpoints matters far more than the model.
  • Move to Markov or Shapley only once paths are reliable (consistent UTM governance — see the Campaign URL Standard — and clean channel grouping via the Channel Classification Standard).
  • Reconcile, don’t religion. Run several models side-by-side (that’s the Simulator’s whole point) and budget against the range, not a single model’s point estimate.
  • Attribution is correlational. For causal claims about a channel, you need incrementality testing (geo holdouts, ghost ads, MMM) — covered in the Experimentation reference, not here.
Download the kit

Templates, validators, and the governance checklist.

Get the kit →