Shapley Attribution Visualizer
Understand how cooperative game theory assigns "fair credit" to marketing channels by analyzing their marginal contribution across every possible coalition combination.
CONCEPT & INTUITION
The Problem: In multi-channel marketing, channels work together. If a user sees a Search Ad and then a Social Post before buying, who gets the credit?
The Shapley Solution: Instead of guessing, we use data. We look at every unique "Coalition" (or 'Channel Mix') that appears in your data. By comparing the conversion rate of users who saw {Search + Social} vs. users who saw {Search + Social + Email}, we can mathematically isolate the value of adding Email to that mix.
๐ก Why This Matters: Real-World Impact
Case Study: A Fortune 500 retailer switched from Last-Click to Shapley attribution and discovered their Display campaigns were being undervalued by 400%. By reallocating budget based on marginal contributions, they increased ROAS by 35% while spending the same total budget.
The Key Insight: Channels that assist high-performing mixes deserve credit, even if they rarely get the "last touch."
๐ Analyst Note: Sets vs. Sequences
This tool focuses on Cooperative Game Theory (Shapley), which treats marketing as a "Team Sport" (Who was on the field?).
Real World Nuance: Advanced engines (like GA4 Data-Driven Attribution) often combine this with Markov Chains to account for order (e.g., "Search then Email" might be worth more than "Email then Search"). While Shapley isolates the value of presence, Sequence models isolate the value of timing.
Key Terms
- Media Mix (or Coalition): The set of unique channels a user interacted with, ignoring order. (e.g., A user who did Search โ Email โ Search has the mix {Search, Email}).
- Marginal Contribution: The difference in Conversion Rate made by adding a specific channel to an existing mix.
- Note on Sequence: Classic Shapley ignores the timestamp order of exposure (unlike Markov Chains). It treats marketing as a "Team Sport" where the presence of the player matters more than when they arrived.
MARKETING SCENARIOS
โ๏ธ Simulation Parameters โผ
Enter a number (e.g. "123") to force the exact same results every time. Useful for classroom demos.
1. RAW USER JOURNEYS
Before any math happens, we just have paths. The Scenario selected above determines the probability that users convert.
2. MEDIA MIX LAB (COALITION ANALYSIS)
Explore the Conversion Rate for specific definitions of "Channel Mix".
Current "Mix" Selection
Toggle channels to filter for this specific mix and see its performance.
3. Synergy Analysis (The "Team Chemistry" Map)
Shapley isn't just about slicing the pie; it's about growing the pie. Use this heatmap to spot which channel pairings create the most "lift".
- Positive Synergy (Green): Cooperative. "Search converts 2%, Social converts 2%, but TOGETHER they convert 6%." (Bonus = +2%).
- Negative Synergy (Red): Redundant. "Search converts 2%, Display converts 2%, but TOGETHER they still only convert 2.5%." (Cannibalization).
4. Inside the Math (The Calculation)
See how we derive the value for a specific channel.
This table mimics the loop the algorithm runs. It asks: "If we take every possible Media Mix that DOES NOT have this Channel, and then we ADD this Channel, how much does the Conversion Rate improve?"
|
Existing Mix โน๏ธ
(Baseline channels)
|
Base Conv. Rate
(Rate WITHOUT Paid Search)
|
New Conv. Rate
(Rate WITH Paid Search)
|
Marginal Impact
(Lift from Paid Search)
|
|---|---|---|---|
| Final Shapley Value (Weighted Average Impact): | -- | ||
๐งฎ Technical Deep Dive: The Shapley Equation (Click to Expand)
The Shapley Value comes from Cooperative Game Theory. It assigns credit based on a player's average marginal contribution across all possible coalitions (team combinations).
The original Shapley formula sums over all \(n!\) permutations (orderings), but this is just a mathematical trick to derive fair weightsโit does NOT mean actual customer journey order matters. 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 below, not by arrival order.
- \(\phi_i\) = The Shapley Value (fair credit) for channel \(i\)
- \(N\) = The set of all channels (e.g., \(\{Search, Social, Email\}\))
- \(n\) = Total number of channels (\(n = |N|\))
- \(S\) = Any coalition (subset) that does NOT include channel \(i\)
- \(v(S)\) = Conversion rate when users saw exactly the channels in \(S\)
- \(v(S \cup \{i\}) - v(S)\) = How much adding channel \(i\) improves the conversion rate
In plain English: For each possible team \(S\) that doesn't include channel \(i\), measure how much \(i\) helps when it joins. Weight by coalition size, then sum.
Let \(S = \{Search\}\) and \(i = Social\).
If \(v(\{Search, Social\}) = 5\%\) and \(v(\{Search\}) = 2\%\), then Social's marginal contribution to this coalition is \(5\% - 2\% = 3\%\).
Without weighting, larger coalitions would dominate (there are more of them). The factorial weights ensure that each coalition size contributes equally to the final value.
Think of it this way: We want to know "How valuable is Search?" We should weight its contribution to a 1-channel mix the same as its contribution to a 3-channel mixโeven though there are more possible 2-channel combinations than 1-channel ones.
4. Final Attribution Results
Aggregating the Shapley Values for ALL channels.
Model Comparison: Accuracy vs. Ego
Comparing Shapley (Colored Bars) against traditional Heuristic models (Grey Bars).
- Last Touch (Dark Grey): Often over-credits the "Closer" (Search) and ignores the "Assists" (Social).
- Linear (Light Grey): Spreads credit like peanut butter. It assumes a cheap banner ad did as much work as a high-intent search.
Junior analysts often look for the model that gives their team the biggest numbers. Don't do this.
The goal of attribution isn't to be "Right" or "high", it's to be Accurate. Shapley is valuable because it reveals the true contributions that Last Touch models (Google Analytics default) often hide.