Tabellab

From Customer Journeys to Transition Counts: Start, Channel Steps, Conversion and Null

Lesson 1 of 20Lab

All lessons
  1. From Customer Journeys to Transition Counts: Start, Channel Steps, Conversion and NullLabFree
  2. The Transition Probability Matrix: Rows that Sum to 1, Absorbing States and Two-Step PathsLab Locked
  3. Conversion Probability from Start: Step-by-Step Convergence and the Exact (I − Q)⁻¹ SolutionLab Locked
  4. Removal Effects: What Happens to Conversions when a Channel DisappearsLab Locked
  5. Attribution Shares: Normalising Removal Effects into Credited Conversions and RevenueLab Locked
  6. Markov vs Last Click vs Linear: Who Gains, Who Loses (with a Chart)Lab Locked
  7. Budget Implications: Cost per Attributed Conversion, ROAS and a Naive ReallocationLab Locked
  8. Sensitivity & Limitations: How Stable Is the Credit, and What Markov Attribution Cannot Tell YouLab Locked
  9. The Fundamental Matrix: Expected Visits per Channel, Path Length and the Null ProbabilityLab Locked
  10. Conversion Odds from Every Channel: Absorption Probabilities N × R, Lift and Direct ClosingLab Locked
  11. Revenue, Not Just Orders: Two Basket Sizes as Absorbing States and Revenue Removal EffectsLab Locked
  12. Partial Cuts: What 25%, 50% and 75% Less of a Channel Does to Conversions (Response Curves)Lab Locked
  13. Testing the Memoryless Assumption: Does the Touch Before Search Change Its Conversion Rate?Lab Locked
  14. First Click, Position-Based and Time Decay: Three More Rule-Based Models Next to MarkovLab Locked
  15. Shapley Values for Channels: Coalition Orders, Fair Weights and a Second Opinion on Markov CreditLab Locked
  16. How Sure Are the Probabilities? Standard Errors, 95% Intervals and the Visits a Channel NeedsLab Locked
  17. A Second Store with Five Channels: Brookvale Outdoor from Counts to Credited OrdersLab Locked
  18. Calibrating Markov Credit with Holdout Tests: Incremental Orders, Calibration Factors and True CPALab Locked
  19. Lookback Windows: How a 7-Day or 30-Day Window Changes the Paths and the CreditLab Locked
  20. Final Project: December Attribution Dashboard for Fernhill Home (Credit, Revenue, ROAS and Flags)Lab Locked

You are not signed in — the lab works, but your progress is not saved. Sign up

Lesson 1 of 20 is free. Unlock all 20 hands-on labs, the final exam and your certificate.

Buy course — €9.90
Loading the spreadsheet…

Why last click hands the credit to the wrong channel

You run marketing or analytics for an online shop. Every month someone asks the same question: which channel actually brings in the orders? The default report in most tools answers with last-click attribution. Whatever the customer touched just before buying gets 100% of the order. It is easy to explain, and for many shops it is badly misleading.

Think about how people really buy home goods. Someone sees a cushion on Instagram, forgets about it, searches for the shop a few days later, signs up for the newsletter, and finally buys from an email. Last click gives the whole order to Email. Social, which created the interest in the first place, gets nothing. Cut the social budget on that basis and a few months later the email list stops growing and search volume drops. Nobody can say why, because the report never showed the dependency.

Markov chain attribution is a data-driven way to share the credit along the whole path. It treats every customer journey as a walk through a set of states, measures how likely each step is, and then asks a simple question for each channel: if this channel disappeared, how many conversions would we lose? That question, the removal effect, is what the later lessons of this course calculate. Everything starts with one practical step, and that step is this free lesson: turning a list of journeys into a transition count table.

This article is for marketing analysts, e-commerce managers, performance marketers and students who know basic Excel (SUM, cell references) and want to understand attribution properly instead of trusting a black-box setting in an ad platform. You will work with Fernhill Home, a fictional online home-goods store, and 14 journey paths that stand for 2,460 visitors and 270 orders in one month. All numbers are illustrative teaching data.

The core idea: states, steps and two possible endings

A Markov chain is a model of something that moves from state to state, where the next step depends only on where you are now. For attribution, the states are:

  • Start: an artificial state every journey begins in. It lets you count which channel people meet first.
  • The channels: here Search, Social, Email and Display. A visitor can pass through one, two or three of them.
  • Conversion: the journey ended with an order. Once you are here you stay here, which is why it is called an absorbing state.
  • Null: the journey ended without an order. Also absorbing.

A journey such as Social → Search → order becomes the walk Start → Social → Search → Conversion. The model does not care about the order of the whole sequence or about time between touches. It only cares about single steps: how often does a visitor go from Start to Social, from Social to Search, from Search to Conversion? Count those steps across all journeys and you have everything the chain needs.

The diagram below shows one path from the lab, P05. It stands for 260 visitors who first came through Social and then through Search. 39 of them bought, 221 did not. Every arrow adds the 260 journeys (or the 39 and 221 at the end) to one cell of the count table.

Path P05 as a walk through the chain (260 journeys)StartSocialSearchConversionNull26026039221Counted cells: Start→Social +260, Social→Search +260,Search→Conversion +39, Search→Null +221 (260 − 39).
Figure 1. Path P05 broken into steps. Every step adds the path's journeys to one cell of the transition count table: one row per "from" state, one column per "to" state.

Why count steps instead of whole paths? Because steps can be recombined. A three-touch path shares its Social → Search step with a two-touch path. Once you have the step counts, you can turn them into probabilities (lesson 2), follow every possible walk at once with matrix multiplication (lesson 3) and simulate what happens when a channel is removed (lesson 4). None of that works on a list of whole paths.

The "next step depends only on the current state" assumption is called a first-order Markov chain. It is a simplification. A visitor who has already seen three ads may behave differently from one who has seen none, even if both are now in Search. Higher-order chains exist, but they need much more data. The first-order chain is the standard starting point and the one this course uses.

Worked example: Fernhill Home's 14 journey paths

The analytics export has been grouped into unique paths. Each row is one exact sequence of touches, with the number of visitors who followed it (Journeys) and how many of them placed an order (Conversions). The last column, Last touch, is the first thing you calculate in the lab.

PathTouch 1Touch 2Touch 3TouchesJourneysConversionsLast touch
P01Search142046Search
P02Social13809Social
P03Email115021Email
P04Display13104Display
P05SocialSearch226039Search
P06DisplaySearch218022Search
P07SearchEmail214027Email
P08SocialEmail29014Email
P09DisplaySocial21206Social
P10EmailSearch27012Search
P11SocialSearchEmail311026Email
P12DisplaySocialSearch39517Search
P13SearchSocialEmail3609Email
P14DisplaySearchEmail37518Email

Column H uses =INDEX(B2:D2,E2). INDEX picks the cell in position E2 of the range B2:D2, so a one-touch path returns touch 1, a two-touch path touch 2, and a three-touch path touch 3. It is shorter and safer than nested IFs such as =IF(E2=1,B2,IF(E2=2,C2,D2)), and it never returns an empty Touch 3 by mistake.

Now build the count table below the paths. Rows are the "from" states (Start and the four channels), columns are the "to" states (the four channels, Conversion and Null). This is the finished table you will reach in the lab:

From \ ToSearchSocialEmailDisplayConversionNullTotal
Start620840220780002,460
Search06032501368891,410
Social46501500154851,115
Email70000115510695
Display255215004306780

Here is how each block is filled, with the exact formulas from the lab sheet (paths in rows 2–15, the table header in row 17, row labels in column A).

  • Start row (B18:E18): journeys whose touch 1 is the channel. =SUMIF($B$2:$B$15,B$17,$F$2:$F$15) in B18, filled right. Start → Social is 840 = 380 + 260 + 90 + 110 (paths P02, P05, P08 and P11). Start never goes straight to Conversion or Null, so F18 and G18 stay 0.
  • Channel → channel (B19:E22): a step can happen between touch 1 and 2 or between touch 2 and 3, so add two SUMIFS: =SUMIFS($F$2:$F$15,$B$2:$B$15,$A19,$C$2:$C$15,B$17)+SUMIFS($F$2:$F$15,$C$2:$C$15,$A19,$D$2:$D$15,B$17). Search → Email is 325 = 140 (P07, step 1→2) + 110 (P11, step 2→3) + 75 (P14, step 2→3).
  • Conversion column (F19:F22): conversions of the paths whose last touch is the channel: =SUMIFS($G$2:$G$15,$H$2:$H$15,$A19). Email → Conversion is 21 + 14 + 26 + 9 + 18 + 27 = 115.
  • Null column (G19:G22): the journeys that ended at that channel without an order: =SUMIFS($F$2:$F$15,$H$2:$H$15,$A19)-F19. Email → Null is 510.
  • Totals (H18:H22): =SUM(B18:G18) and copied down.

Notice the mixed references. $A19 locks the column of the "from" label but lets the row move when you copy down. B$17 locks the row of the "to" label but lets the column move when you copy right. One formula, written once, fills the whole 4 × 4 block. Getting the dollar signs right is the most useful Excel habit in this entire course.

Two checks prove the table is right. First, the Start total must equal all journeys: 2,460. Second, the Conversion column must add up to all orders: 136 + 15 + 115 + 4 = 270. A third, stronger check: each channel's row total must equal the journeys that passed through it. Search appears in nine paths with 1,410 journeys, and its row total is 1,410.

What the counts already tell you

Even before any probabilities, the table changes the conversation. Look at Social. It is the most common first touch: 840 of 2,460 journeys start there. Yet only 15 orders have Social as their last touch. Under last click, Social looks almost useless. Under the counts, Social sends 465 journeys on to Search and 150 to Email, the two channels that collect most of the last-click credit.

Where journeys start vs how often they pass throughStart → channel (first touches)Row total (passes through)04008001,2001,600journeys6201,410Search8401,115Social220695Email780780Display
Figure 2. First touches (Start row) next to row totals (every pass through the channel). Social and Display start many journeys. Search and Email collect visitors from other channels, so their row totals are much larger than their first-touch counts.

Display tells a similar story: 780 journeys start there, but it is never reached from another channel, so its row total is also 780, and only 4 orders end on it. Email is the opposite: few people start with Email (220), but many arrive from Search and Social, and it closes 115 orders. The count table already shows the roles: Social and Display open journeys, Search carries them, Email closes them.

Lessons 2 to 5 turn this into numbers you can defend. For orientation, here is where the full course ends up for these same 270 orders. Last click credits Search with 136 orders and Social with 15. The Markov chain built from your count table credits Search with about 108 and Social with about 60, roughly four times as much. Display goes from 4 to about 34.

Credited orders (of 270): last click vs MarkovLast clickMarkov (removal effects)04080120160orders136108Search1560Social11568Email434Display
Figure 3. Preview of lesson 5, calculated from the same count table: credited orders by channel under last click and under Markov removal effects (rounded). The totals are the same 270 orders. Only the split changes.

How to build the transition count table in Excel, step by step

Open the lab above (or your own export laid out the same way) and follow these steps. Shortcuts are for Windows. On a Mac use Cmd instead of Ctrl, and Fn+F4 or Cmd+T for the reference toggle.

  1. Lay out the paths. One row per unique path, one column per touch position, then Touches, Journeys and Conversions. If your tool exports one row per visitor, group first with Insert → PivotTable, putting the path in Rows and a count of visitors in Values.
  2. Add the last touch. In H2 type =INDEX(B2:D2,E2), press Enter, select H2:H15 and press Ctrl+D to fill down.
  3. Write the table headers. In row 17 put From \ To, the four channels, Conversion, Null and Total. In A18:A22 put Start and the four channels. Spell them exactly as in the path columns, because SUMIF matches text exactly (case is ignored, spaces are not).
  4. Fill the Start row. In B18 type =SUMIF($B$2:$B$15,B$17,$F$2:$F$15). Use F4 while the cursor is inside each reference to add the dollar signs. Select B18:E18 and press Ctrl+R.
  5. Fill the channel block. In B19 enter the double SUMIFS formula from the worked example. Select B19:E22, then press Ctrl+D and Ctrl+R. You can also find SUMIFS under Formulas → Math & Trig and fill in the dialog box if you prefer.
  6. Fill Conversion and Null. F19: =SUMIFS($G$2:$G$15,$H$2:$H$15,$A19). G19: =SUMIFS($F$2:$F$15,$H$2:$H$15,$A19)-F19. Fill both down to row 22.
  7. Add totals. Select B18:H22 and press Alt+= (AutoSum), or type =SUM(B18:G18) in H18 and fill down.
  8. Audit. Press Ctrl+` to show all formulas and check that every reference moves the way it should. Then check the totals against 2,460 journeys and 270 orders. A colour scale (Home → Conditional Formatting → Color Scales) on B18:G22 makes the big flows easy to see.

Markov chain attribution course: customer journeys turned into channel transition counts in Excel
Markov chain attribution in Excel: from raw journey paths to a transition count table, then to probabilities, removal effects and fair channel credit.

Common mistakes and how to spot them

Most errors in this step are silent: the table fills with plausible numbers that are simply wrong. These are the ones that come up again and again.

  • Counting paths instead of journeys. =COUNTIF(B2:B15,"Social") returns 4 (four paths start with Social), not 840 journeys. Spot it: your Start total is 14 instead of 2,460.
  • Only counting the first step. One SUMIFS for touch 1 → touch 2 misses every touch 2 → touch 3 step. Spot it: a channel's row total is smaller than the journeys passing through it. Search → Email shows 140 instead of 325.
  • Using the first touch for the ending. If the Conversion column is filled from touch 1, the conversions of multi-touch paths land on the wrong channel. Spot it: Social suddenly has a large Conversion count.
  • Forgetting Null. Without the Null column, every row seems to lead only to channels and conversions, and the probabilities in lesson 2 will be far too high. Spot it: the row total of Display is 4 instead of 780.
  • Wrong dollar signs. $A$19 instead of $A19 makes every row look up Search. Spot it: four identical rows.
  • Inconsistent channel names. "Paid Search" in one place and "Search" in another, or a trailing space. SUMIF will silently return 0. Spot it: a cell that should clearly have traffic shows 0. Clean the labels with =TRIM() or Find & Replace (Ctrl+H).
  • Self-loops ignored by accident. Real exports often contain Search → Search (two paid clicks in a row). Decide on purpose whether to keep or merge repeated touches. Merging is common. Either way, write the rule down.

Quick reference: functions and shortcuts used in this lesson

Function / shortcutWhat it does hereExample
INDEXReturns the n-th cell of a range: the last touch of a path=INDEX(B2:D2,E2)
SUMIFAdds journeys of rows that match one condition=SUMIF($B$2:$B$15,B$17,$F$2:$F$15)
SUMIFSAdds journeys that match two or more conditions (one step from → to)=SUMIFS($F$2:$F$15,$B$2:$B$15,$A19,$C$2:$C$15,B$17)
SUMPRODUCTMultiplies arrays of TRUE/FALSE tests with numbers and adds the result=SUMPRODUCT(($H$2:$H$15=$A19)*$G$2:$G$15)
COUNTIFCounts rows (paths), not journeys: useful for a sanity check only=COUNTIF(B2:B15,"Search")
SUMRow and column totals for the checks=SUM(B18:G18)
F4Cycles a reference through $A$1, A$1, $A1 and A1Press while the cursor is in a reference
Ctrl+D / Ctrl+RFill down / fill right from the first cell of a selectionSelect B18:E18, press Ctrl+R
Ctrl+`Shows formulas instead of results, to audit a whole blockToggle on and off

Real-world uses of a transition count table

The count table is useful well beyond the final attribution model. Some typical situations:

  • Budget review. A shop is about to cut a prospecting channel that looks weak under last click. The Start row and the channel → channel block show how many journeys it feeds into the closing channels, which is the evidence needed before cutting.
  • Email and CRM planning. A high Search → Email count tells you that many visitors find you through search and then sign up. That is a reason to improve the sign-up on search landing pages.
  • Agency reporting. An agency that runs Social for a client can show the client the journeys Social started, instead of arguing about last-click numbers.
  • Data quality checks. A sudden jump in Start → Null for one channel often means broken tracking or a landing page error, long before revenue reports show it.
  • Teaching and stakeholder buy-in. A count table is something non-analysts can read. It is a good way to explain why the team is moving away from last click before showing any matrix algebra.

What you will build in the rest of this course

This free lesson builds the foundation. The paid course ($9.90, one-time) takes the same Fernhill Home data all the way to channel credit, budget decisions and an honest view of the uncertainty. Each lesson has its own lab sheet with the Coach checking your formulas.

The Transition Probability Matrix: Rows that Sum to 1, Absorbing States and Two-Step Paths. You divide each count by its row total to get the transition probability matrix, add the absorbing Conversion and Null rows, and use MMULT to see where a visitor is likely to be two and three steps later.

Conversion Probability from Start: Step-by-Step Convergence and the Exact (I − Q)⁻¹ Solution. You follow a visitor from Start through ten steps, watch the conversion probability settle, and then solve it exactly with the fundamental matrix (I − Q)⁻¹ using MINVERSE, and compare the result with the observed conversion rate.

Removal Effects: What Happens to Conversions when a Channel Disappears. The heart of the method: you remove one channel at a time, recalculate the chance of converting, and turn the drop into a removal effect for every channel with a single masked MINVERSE formula.

Attribution Shares: Normalising Removal Effects into Credited Conversions and Revenue. Removal effects add up to more than 100%, so you normalise them into shares and turn them into credited orders and revenue that add up exactly to what the shop sold.

Markov vs Last Click vs Linear: Who Gains, Who Loses (with a Chart). You calculate last-click and linear credit from the same journeys, set them next to Markov, find the channel last click undervalues most, and build a comparison chart for your report.

Budget Implications: Cost per Attributed Conversion, ROAS and a Naive Reallocation. You put a price on the results: cost per attributed conversion and ROAS per channel under both models, and a naive budget reallocation by Markov credit, with a clear discussion of why that is a starting point and not a plan.

Sensitivity & Limitations: How Stable Is the Credit, and What Markov Attribution Cannot Tell You. You run the model on three months, measure how much each channel's share moves with the coefficient of variation, flag unstable credit and learn what Markov attribution cannot tell you, such as true incrementality.

Summary

Markov chain attribution starts with a simple, very practical step: break every journey into single steps and count them, weighted by the number of visitors on each path. INDEX finds the last touch, SUMIF fills the Start row, a pair of SUMIFS fills the channel → channel block, and SUMIFS on the last touch fills Conversion and Null. Two totals, 2,460 journeys and 270 orders, prove the table is right.

Even this first table shows things last click hides: Social and Display open most journeys, Search carries them, and Email closes them. Try it now in the lab above. Fill the last touch column, build the Start row and the channel block, and let the Coach check your cells. When the totals match, you are ready to turn counts into probabilities.

Frequently asked questions

What is Markov chain attribution?

It is a data-driven attribution model that treats customer journeys as walks between states (channels, conversion and no conversion). Each channel is credited by its removal effect: how many conversions would be lost if the channel were taken out of the journeys.

Can I do Markov chain attribution in Excel?

Yes. With a manageable number of channels you can count transitions with SUMIF and SUMIFS, build the probability matrix by dividing by row totals, and solve the chain with MMULT and MINVERSE. This course does every step in Excel.

What is a transition matrix in marketing attribution?

It is a table with one row per "from" state and one column per "to" state. The counts version shows how many journeys made each step, and the probability version divides each row by its total so that every row sums to 1.

What does the Null state mean?

Null is the ending for journeys that did not convert. Without it the model would assume every journey eventually converts, and the conversion probabilities would be far too high.

How is Markov attribution different from last-click attribution?

Last click gives each order entirely to the final touch. Markov attribution looks at the whole path and shares the credit according to how much each channel contributes to reaching conversion, so channels that start or carry journeys get credit too.

How much data do I need for a Markov attribution model?

There is no fixed number, but every transition you rely on should be based on enough journeys that it does not jump around from month to month. Grouping rare channels and checking stability over several periods, as in lab 8 of this course, is a sensible approach.

Keep going: Markov Chain Attribution: Channel Paths, Removal Effects & Fair Credit

This free lab is lesson 1 of 20. Unlock the other 19 hands-on labs, the final exam and your certificate for a one-time €9.90.

  1. The Transition Probability Matrix: Rows that Sum to 1, Absorbing States and Two-Step Paths
  2. Conversion Probability from Start: Step-by-Step Convergence and the Exact (I − Q)⁻¹ Solution
  3. Removal Effects: What Happens to Conversions when a Channel Disappears
  4. Attribution Shares: Normalising Removal Effects into Credited Conversions and Revenue
  5. Markov vs Last Click vs Linear: Who Gains, Who Loses (with a Chart)
  6. Budget Implications: Cost per Attributed Conversion, ROAS and a Naive Reallocation
  7. Sensitivity & Limitations: How Stable Is the Credit, and What Markov Attribution Cannot Tell You
  8. The Fundamental Matrix: Expected Visits per Channel, Path Length and the Null Probability
  9. Conversion Odds from Every Channel: Absorption Probabilities N × R, Lift and Direct Closing
  10. Revenue, Not Just Orders: Two Basket Sizes as Absorbing States and Revenue Removal Effects
  11. Partial Cuts: What 25%, 50% and 75% Less of a Channel Does to Conversions (Response Curves)
  12. Testing the Memoryless Assumption: Does the Touch Before Search Change Its Conversion Rate?
  13. First Click, Position-Based and Time Decay: Three More Rule-Based Models Next to Markov
  14. Shapley Values for Channels: Coalition Orders, Fair Weights and a Second Opinion on Markov Credit
  15. How Sure Are the Probabilities? Standard Errors, 95% Intervals and the Visits a Channel Needs
  16. A Second Store with Five Channels: Brookvale Outdoor from Counts to Credited Orders
  17. Calibrating Markov Credit with Holdout Tests: Incremental Orders, Calibration Factors and True CPA
  18. Lookback Windows: How a 7-Day or 30-Day Window Changes the Paths and the Credit
  19. Final Project: December Attribution Dashboard for Fernhill Home (Credit, Revenue, ROAS and Flags)

Buy course — €9.90 See the full course