Shapley Attribution Visualizer

Marketing Analytics

Understand how cooperative game theory assigns "fair credit" to marketing channels by analyzing their marginal contribution across every possible coalition combination.

👨‍🏫 Professor Mode: Guided Learning Experience

New to Shapley value attribution? Enable Professor Mode for step-by-step guidance through understanding how each channel contributes to conversions!

OVERVIEW & WHAT THIS TOOL SOLVES

Customer journeys cross multiple touchpoints (Search, Social, Email, Display). Shapley tests every coalition to isolate each channel's true marginal lift.

Customers rarely buy after a single ad click—a shopper might discover your brand on Paid Social, research via Paid Search, and convert after a Retargeting Display ad. Naive attribution rules like First-Touch or Last-Touch give 100% of the credit to one endpoint and starve the upper- or mid-funnel channels that assisted the sale. Shapley Value Attribution applies the Shapley value from cooperative game theory (Lloyd Shapley, 1953) to compare every possible coalition of channels and award each touchpoint its exact average marginal contribution to conversion.

🎯 Questions It Answers

  • How much conversion credit does each channel deserve after accounting for all multi-touch interactions?
  • Which channels act as essential "synergy catalysts" that boost conversion rates when paired with others?
  • Which channels look strong under Last-Touch only because they poach customers who were already going to buy?

📂 What Data You Need

  • Coalition Conversion Rates (or journey counts & conversions) for each observed subset of channels
  • Channel Definitions (typically 3 to 5 core marketing channels such as Search, Social, Email, Display)
  • No Organic Baseline (the tool sets the conversion rate for zero channels to 0%; uploaded rows with no recognized channel are excluded)

💡 What You'll Discover

  • Shapley Attribution Shares: Fair-division credit weights that sum to 100% of total incremental value
  • Heuristic Bias Comparison: Side-by-side gap between Shapley credit and the Last-Touch and Linear rules
  • Coalition Marginal Lift Breakdown: Exact step-by-step table showing how much a channel adds when joining any existing subset
🔍 Key Nuances & Common Traps to Watch For
  • Order-Invariance of Set Coalitions: Classic Shapley attribution treats a customer journey as an unordered set of channels (e.g., {Search, Social} = {Social, Search}). If sequence order matters critically, compare with a Markov Chain transition model.
  • Selection Bias in Observational Paths: Observed coalition conversion rates reflect correlation, not automatically causal lift. If high-intent buyers naturally search your brand name right before purchasing, Search coalitions will show high conversion rates unless calibrated with incrementality experiments.
  • Exponential Coalition Growth (2n): With 4 channels there are 16 coalitions; with 10 channels there are 1,024. Keep channel groupings at the strategic level (4–6 macro channels) so every coalition has enough customer journeys to estimate reliably.
📐 Under the Hood: Model Equations & Variable Definitions

1. Marginal Contribution of Channel i to Coalition S

\[ \Delta_i(S) = v(S \cup \{i\}) - v(S) \]

💬 Read it in plain English: A channel's marginal contribution to any existing team of channels is simply the total conversion value when that channel is added minus the conversion value that the team achieved without it.

Δi(S)
Marginal ContributionOUTPUT ⓘ
Incremental conversion value added when channel i joins existing coalition S.
S
Existing Channel CoalitionYOUR DATA ⓘ
Any subset of marketing channels that does not yet include channel i.
v(S)
Characteristic Value of SYOUR DATA ⓘ
Observed conversion rate or total conversions generated when customers are exposed only to subset S (a modeled rate when too few journeys saw exactly S).
v(S ∪ {i})
Coalition Value With Channel iYOUR DATA ⓘ
Observed conversion rate or total conversions when channel i is added to subset S.

2. Shapley Value Fair-Credit Equation

\[ \phi_i(v) = \sum_{S \subseteq N \setminus \{i\}} \frac{|S|!\,(|N| - |S| - 1)!}{|N|!} \left[ v(S \cup \{i\}) - v(S) \right] \]

💬 Read it in plain English: A channel's Shapley value is the weighted average of its marginal contribution across every possible coalition it could join, weighting each coalition by the fraction of all possible channel arrival orders in which that exact coalition precedes channel i.

ϕi(v)
Shapley Value for Channel iOUTPUT ⓘ
Fair attribution credit assigned to channel i; all channels’ Shapley values sum to v(N) − v(∅).
N
Grand Coalition (All Channels)YOUR DATA ⓘ
Complete set of all marketing channels included in the attribution study.
|N|
Total Number of ChannelsYOUR DATA ⓘ
Count of distinct marketing channels in the model (there are |N|! possible arrival orderings).
|S|
Coalition Size Before Channel iYOUR DATA ⓘ
Number of channels already present in subset S before channel i joins.
|S|!(|N|−|S|−1)! / |N|!
Combinatorial Permutation WeightINFERENCE ⓘ
Probability that across a random permutation of all |N| channels, the exact subset S appears before channel i.

MARKETING SCENARIOS & DATA SOURCE

Use a Marketing Case Study

5 Guided Cases
Loading scenario details...
Switch to a pre-built case study →

Upload Custom Journey Data

CSV Import

Upload customer journey logs with columns Path_ID (nominal identifier), Channel_Sequence (categorical sequence separated by -> or , using search, social, displayA, displayB, email), and binary outcome Converted (1 = converted, 0 = did not convert).

Drag & drop a journey CSV file here, or click to browse

Supports .csv or .tsv (recommended 50+ tracked journeys)

Need help formatting? Open Import Wizard
Have your own journey data? Upload a CSV →
⚙️ Simulation Parameters ▼

The seed starts at 42, so everyone who loads a case sees the same journeys. Enter another number (e.g. "123") and press Set for a different set.

Simulation Note: Each case generates 40,000 user journeys (Case E: 20,000; Case F: 33,000) typical for its type of business, standing for ten months of tracking (Case F: the 30 days of one launch). Each channel mix converts at the rate the case is built to show, to the nearest whole journey. Notice how upper-funnel awareness touches (Social, Display) tend to precede mid-funnel consideration (Email) and bottom-funnel closers (Paid Search / AE Demo). While Last Touch only sees who stood at the finish line, Shapley Math evaluates every coalition's conversion rate.

1. RAW USER JOURNEYS

40,000 tracked journeys from the data source above

Before any math happens, we just have paths. The Scenario selected above determines both how journeys flow through the funnel and the rate at which each channel mix converts.

Total Paths
40,000
Total Conversions
?
Sample Conv. Rate (Traffic Avg)
?
5-Channel Ceiling \(v(N)\)
?
Why does \(v(N)\) differ from Sample Conv. Rate? The Sample Conv. Rate averages across all users (most of whom only saw 1 or 2 channels). By game theory's Efficiency Axiom, the sum of all 5 Shapley values is \(\sum_{i=1}^{5}\phi_i = v(N) - v(\emptyset)\). The tool sets \(v(\emptyset) = 0\), so the sum equals the 5-Channel Ceiling \(v(N)\): the conversion rate achieved when a user experiences the full marketing ecosystem. When too few journeys touched all five channels (fewer than 100 in a case, none in an uploaded file; Cases A and D allow at most three and two touches, so none do), \(v(N)\) is a modeled rate, not a measured one.

2. MEDIA MIX LAB (COALITION ANALYSIS)

Explore the Conversion Rate \(v(S)\) for specific definitions of "Channel Mix" (unordered sets of channels).

Current "Mix" Selection

Toggle channels to filter for this specific coalition \(S\) and see its conversion rate, sample support, and synergy bonus.

Conversion Rate \(v(S)\) for this Media Mix:
0.0%
Select a scenario to inspect sample support

Drag to try a what-if rate for this mix. The rate above stays as the data gave it (measured, or modeled for a mix with too few journeys); the Shapley charts and calculation table use the what-if until you reset it.

3. Synergy Analysis (The "Team Chemistry" Map)

Shapley isn't just about slicing the pie; it's about growing the pie. Use this heatmap of pairwise interaction \(I_{A,B} = v(\{A,B\}) - v(\{A\}) - v(\{B\}) + v(\emptyset)\) to spot which channel pairings create the most lift.

Interpretation Guide:
  • Positive Synergy (Green, \(I_{A,B} > 0\)): Cooperative. "Search converts 2%, Social converts 2%, but TOGETHER they convert 6%." (Bonus = +2%).
  • Negative Synergy (Red, \(I_{A,B} < 0\)): Redundant / Saturated. "Search converts 2%, Display converts 2%, but TOGETHER they still only convert 2.5%." (Cannibalization).
  • Interactive Sync: Click any square in the heatmap to load that 2-channel pair directly into Section 2's Media Mix Lab!

4. Inside the Math (The Calculation)

See how we derive the exact Shapley value \(\phi_i\) for a specific channel across all \(2^{n-1} = 16\) baseline coalitions, grouped by coalition size \(|S|\).

💡 Click any row below to load that mix into the Media Mix Lab

This table shows every step of the exact Shapley equation. Because there are 5 channels, there are 5 coalition-size tiers (\(|S| = 0, 1, 2, 3, 4\)). Each size tier receives an equal \(1/5 = 20.0\%\) total weight, split evenly among the mixes of that size.

Existing Mix \(S\)
(Baseline channels before entry)
Base Rate \(v(S)\)
(Rate WITHOUT Paid Search)
New Rate \(v(S \cup \{i\})\)
(Rate WITH Paid Search)
Marginal Impact \(\Delta\)
(Lift from Paid Search)
Shapley Weight \(w(S)\)
(Exact combinatoric share)
Weighted Credit
(\(w(S) \times \Delta\))
Final Shapley Value \(\phi_i = \sum w(S)\cdot\Delta_i(S)\): \(\sum w = 100\%\) --
🧮 Technical Deep Dive: The Shapley Equation & Equal Tier Weights (Click to Expand)

The Shapley Value comes from Cooperative Game Theory (Lloyd Shapley, 1953). It assigns credit based on a player's average marginal contribution across all possible coalitions (team combinations).

⚠️ Common Confusion: "Permutations" vs. "Coalitions"

The original Shapley formula sums over all \(n!\) permutations (orderings), but this is just a mathematical device to derive fair weights—it does NOT mean actual customer journey timestamp order enters \(v(S)\). The final Shapley value depends only on which channels were present (the coalition), not the sequence they appeared in. That's why we group by coalition size \(|S|\) above.

\[ \phi_i = \sum_{S \subseteq N \setminus \{i\}} \frac{|S|!(n-|S|-1)!}{n!} \cdot \underbrace{[v(S \cup \{i\}) - v(S)]}_{\text{Marginal Contribution } \Delta_i(S)} = \frac{1}{n}\sum_{k=0}^{n-1} \overline{\Delta}_i^{(k)} \]
Where:
  • \(\phi_i\) = The Shapley Value (fair conversion rate credit) for channel \(i\)
  • \(N\) = The set of all channels (e.g., \(\{\text{Search, Social, Display (Ad A), Display (Ad B), Email}\}\))
  • \(n\) = Total number of channels (\(n = |N| = 5\))
  • \(S\) = Any coalition (subset) that does NOT include channel \(i\)
  • \(v(S)\) = Conversion rate when users saw the exact set of channels in \(S\)
  • \(\overline{\Delta}_i^{(k)}\) = Average marginal lift of channel \(i\) across all \(\binom{n-1}{k}\) coalitions of size \(|S|=k\)
Why the Weighting? (How \(1/5\), \(1/20\), and \(1/30\) Sum to \(100\%\))

With \(n = 5\) channels, there are \(2^4 = 16\) baseline mixes without channel \(i\):
• Size \(|S|=0\): \(1\) mix (Empty) \(\times \frac{1}{5} (20.0\%) = 20.0\%\)
• Size \(|S|=1\): \(4\) single-channel mixes \(\times \frac{1}{20} (5.0\%) = 20.0\%\)
• Size \(|S|=2\): \(6\) two-channel mixes \(\times \frac{1}{30} (3.33\%) = 20.0\%\)
• Size \(|S|=3\): \(4\) three-channel mixes \(\times \frac{1}{20} (5.0\%) = 20.0\%\)
• Size \(|S|=4\): \(1\) four-channel mix \(\times \frac{1}{5} (20.0\%) = 20.0\%\)
Every team size gets an equal \(20\%\) vote!

5. Final Attribution Results & Budget Reallocation

Aggregating the Shapley Values \(\phi_i\) across all 5 channels (left) and decomposing where each channel earns its credit by coalition size \(|S|\) (right).

A. Total Shapley Credit & Share by Channel

Bar height = marginal conversion rate lift \(\phi_i\); label in parentheses = % share of total credit.

B. Where Credit Is Earned (By Coalition Size Tier \(|S|\))

Shows how much of each channel's Shapley value comes from Solo entry (\(|S|=0\)) vs. multi-channel teamwork (\(|S|\ge 1\)).

Model Comparison: Accuracy vs. Ego

Comparing Shapley (Colored Bars) against traditional Heuristic models (Linear Equal-Split and Last Touch) computed on the exact same converting journeys.

Why the Heuristic Bars Differ:
  • Last Touch (Dark Slate): Awards 100% of every conversion to the final touchpoint before purchase—over-crediting bottom-funnel "Closers" (like Paid Search or AE Demo) and starving upper-funnel "Assists" (like Social or Trade Shows).
  • Linear (Striped Slate): Spreads credit equally across every touchpoint on converting paths, ignoring whether a channel actually lifts conversion probability over baseline.
💡 The Teaching Insight:

Junior analysts often pick the attribution rule that makes their own channel look biggest. Don't do this.

When you cut an "assist" channel that Last Touch undervalued, conversions in your "closer" channel collapse too. Use the Credit Shift chart and Budget Table below to spot where Last Touch misallocates spend.

Model Comparison (Scaled to Grand Coalition Lift)

The Misattribution Gap (Shapley Share % − Last-Touch Share %)

💰 Managerial Bridge: From Attribution Share to Budget & ROAS

Comparing current monthly spend against Last-Touch vs. Shapley attributed conversions and revenue.

Channel Monthly Spend (% Budget) Last-Touch Share (Conv.) Shapley Fair Share (Conv.) Credit Shift (\(\Delta\) Share) Last-Touch ROAS vs. Shapley ROAS Budget Action
Select a scenario to view budget & ROAS reallocation analysis.