Markov Chain Attribution Lab

Advanced Analytics

Unlike game theory, Markov Chains care about Sequence. Analyze the "Customer Journey" as a network of probabilities, determining which steps act as the critical bridges to conversion.

👨‍🏫 Professor Mode: Guided Learning Experience

New to Markov chain attribution? Enable Professor Mode for step-by-step guidance through building and interpreting your attribution model!

OVERVIEW & WHAT THIS TOOL SOLVES

Last-Touch attribution gives 100% of conversion credit to the final click before checkout—starving upper-funnel channels like Paid Social or Display that introduced the customer and fed the search funnel. Unlike order-blind Shapley values, the Markov Chain Attribution Lab models customer journeys as a directed transition graph across touchpoint states and asks a sharp counterfactual question: if we silenced Channel k completely, what fraction of total conversions would vanish?

🎯 Questions It Answers

  • What are the step-by-step transition probabilities from Start through each marketing channel to Conversion or Null (drop-off)?
  • If we remove a specific channel from the network, how much does the system-wide conversion rate collapse (Removal Effect)?
  • How far does Last-Touch credit sit from sequence-aware Markov attribution and order-blind Shapley values, and where do those two disagree with each other?

📂 What Data You Need

  • Customer Path Data: Ordered multi-touch sequences (e.g., Social → Email → Paid Search) with conversion/drop-off outcomes
  • Simulation or Preset Mode: Load a realistic multi-channel funnel scenario or generate synthetic customer paths
  • Channel Removal Buttons: Use the Remove buttons in the Removal Effect Lab to silence one channel and see how far the conversion rate falls

💡 What You'll Discover

  • Directed Transition Graph & Heatmap: State-to-state transition matrix P_{ij} from Start to Conversion and Drop-Off
  • Counterfactual Removal Effect: Exact conversion collapse when each channel is redirected to the absorbing Null state
  • Five-Method Comparison: Each channel's share of credit under Last-Touch, First-Touch, Linear, Shapley and Markov attribution, from the same journeys
🔍 Key Nuances & Common Traps to Watch For
  • First-Order Memorylessness (Markov Property): A first-order Markov chain assumes the probability of moving from State A to State B depends only on being in State A right now—not on which channels preceded A earlier in the journey.
  • Why Raw Removal Effects Sum to More Than 100%: If every converting customer must pass through both Social and Paid Search, removing Social drops conversions by 100% and removing Search also drops conversions by 100%. Normalizing each channel's removal effect by the sum of all removal effects yields clean 100% credit shares.
  • Observational Graph vs. Causal Incrementality: Redirecting silenced traffic to the Null state assumes customers who lose a touchpoint never find another route to your site; validate major budget reallocations with a geo-holdout or lift test.
📐 Under the Hood: Model Equations & Variable Definitions

1. First-Order Markov Transition Probability & Baseline Conversion Rate

\[ P_{ij} = P(S_{t+1} = j \mid S_t = i) = \frac{N_{i \to j}}{\sum_{m} N_{i \to m}}, \qquad P(\text{Conv}) = \sum_{\pi \in \Pi_{\text{conv}}} \prod_{(i \to j) \in \pi} P_{ij} \]

💬 Read it in plain English: Each arrow's transition probability P_{ij} is the share of journeys at state i that move next to state j, and the overall baseline conversion rate P(Conv) sums the probabilities of all paths leading from Start to the absorbing Conversion state.

Ni→j
Observed State TransitionsYOUR DATA ⓘ
Number of customer journey steps moving directly from state i to state j.
Pij
Markov Transition ProbabilityESTIMATED ⓘ
Estimated probability of transitioning from state i to state j in one step.
P(Conv)
Baseline System Conversion RateOUTPUT ⓘ
Absorbing probability of reaching Conversion from Start across the full transition matrix.

2. Channel Removal Effect (RE_k) & Normalized Markov Attribution Share

\[ \text{RE}_k = 1 - \frac{P(\text{Conv} \mid \text{remove } k)}{P(\text{Conv})}, \qquad w_k^{\text{Markov}} = \frac{\text{RE}_k}{\sum_{m=1}^{K} \text{RE}_m} \]

💬 Read it in plain English: We zero out channel k (redirecting all traffic entering k to Drop-Off) to see the fractional drop in conversions RE_k, then divide each channel's removal effect by the sum of all removal effects so attribution shares add to 100%.

P(Conv | remove k)
Counterfactual Conversion RateESTIMATED ⓘ
System conversion probability when all transitions into channel k are routed to Null.
REk
Channel Removal EffectOUTPUT ⓘ
Proportion of total conversions lost when channel k is removed from the network.
wkMarkov
Normalized Markov Credit ShareOUTPUT ⓘ
Channel k’s share of total attributed conversions (sums to 100% across all K channels).

MARKETING SCENARIOS

Loading scenario details...
⚙️ Simulation Parameters ▼

The seed starts at 42, so everyone sees the same journeys, and the Shapley tool loads the same ones for this case. Enter another number and press Set for a different set.

No scenario loaded yet.

1. The Raw Data: Customer Journeys

Before building the network, we must look at the raw sequences. Markov cares deeply about the order of these steps (e.g., does Search come before Social?).

Total Sessions
-
Total Conversions
-
Overall Conversion Rate
-

2. Visualizing the Flow (Sankey Diagram)

The table above is hard to read. A Sankey Diagram aggregates all those paths into a single "River of Traffic".

Tip for Reading:
The width of a link is the number of journeys that take that step, so most of the river ends in "Lost".
Hover over any link to see how many journeys take the step, and what share of the journeys at A go on to B.

3. The Transition Matrix

The core brain of the Markov model. Probability of moving from Row (Left) to Column (Top).

How to read this:
  • Rows = "From" state. Columns = "To" state.
  • Example: Find Row "Start" and Column "Search". The number (e.g., 40%) means "40% of users go immediately from Start → Search".
  • Rows sum to 100% (everyone has to go somewhere next).

3b. The Ecosystem Map (Network Analysis)

While the Heatmap shows probabilities, this Network Graph reveals the "gravity" of your marketing ecosystem. It draws the same transition data as a flow map: Start on the left, the channels stacked in the middle, and Converted and Lost on the right.

🧮 Under the Hood: Network Theory (Click to Expand)

The node positions are fixed, not computed: Start on the left, the channels stacked in the middle, and the two absorbing states (Converted and Lost) on the right. Only node size and line thickness carry the data.

Mathematical Basis:
  • Node Size grows with the square root of the number of visits to that state across all journeys (repeat visits count).
  • Edge Thickness grows with the square root of the transition probability \(P(X_{t+1}|X_t)\).

*Mathematically equivalent to the Matrix, but highlights "Ecosystem Clusters".

Visualization Key:
  • 🔵 Nodes (Circles): Represents a Channel.
    Bigger Circle = More Traffic passing through.
  • ➡️ Edges (Lines): Represents a Transition.
    Thicker Line = Higher Probability.
💡 Insight: Look for "Hubs" (central nodes connected to everything) versus "Islands" (channels disconnected from the main flow).

4. The "Removal Effect" Lab

How we calculate attribution: Simulate a "Blackout" of one channel and measure the panic.

🌍 Overview: The "Blackout" Simulation

Before drilling into details, let's look at the big picture. We simulated removing each channel individually and measured the % drop in global conversions.

Interpretation:
A high bar means the channel is a Vital Organ (removing it kills conversions).
A low bar means the channel is Redundant (few converting journeys pass through it).

🧪 Deep Dive: Single Channel Removal Lab

Select a channel to simulate a total outage. If the channel is critical (a bridge), conversions will crash.

Final Markov Attribution Results

5. COMPARING ATTRIBUTION METHODS

Same journeys, five ways to share the credit for a conversion. Each row is a channel and each marker is one method's answer for that channel. Every method's shares add to 100%, so markers in the same row can be compared directly. The grey bar behind them runs from the lowest share to the highest: a long bar means the methods disagree about that channel.

Select a scenario to compare the methods.

Share of conversion credit by attribution method (each column adds to 100%)
Channel Last-Touch First-Touch Linear Shapley Markov
Select a scenario to fill this table.

💡 What Each Method Asks

  • Last-Touch: Which channel was the final touch before the conversion? It takes all the credit.
  • First-Touch: Which channel opened the journey? It takes all the credit.
  • Linear: Every touch in a converting journey takes an equal slice.
  • Shapley: When this channel joins a mix of other channels, how much does the mix's conversion rate rise, averaged over every possible mix? The order of the touches is ignored.
  • Markov: If this channel were deleted from the journey map, how much of the conversion flow would be lost? The order of the touches matters, one step at a time.
🎯 Reading Guide:
  • Last-Touch far above Shapley and Markov: the channel closes journeys that other channels opened, so its Last-Touch credit depends on those openers.
  • Shapley and Markov close together: two methods with different assumptions reach the same verdict about that channel, which is stronger evidence than either one alone.
  • Markov above Shapley: the channel sits on a large share of the converting paths, often as the last step, but adding it to a mix raises the mix's conversion rate by less than that presence suggests.
  • Shapley above Markov: adding the channel to a mix raises conversion by more than its place on the paths suggests. That is typical of a channel that opens journeys: the Markov map is memoryless, so it forgets how a journey began.

All five methods read the same observed journeys. None of them proves that a channel causes conversions; a holdout or lift test does that.