TapCub is live — analytics, insights and live chat, free on one platform
Analytics

Sankey Diagram: When It Beats a Funnel for Reading User Paths

The same 8,000 sessions read as a funnel and as a Sankey diagram, how to build the link table from raw pageviews, and the point where bands stop being readable.

Lin Zhou Published Dec 3, 2026 16 min read Analytics
Sample data: a language school's 8,000 home-page sessions. The funnel the team assumed carries about a quarter of the bookings.Sample data

A Sankey diagram shows flows between nodes with bands whose width matches the quantity moving. For user paths, it beats a funnel when you do not yet know the route: a funnel counts everyone who deviates as lost, while a Sankey shows where they went. Once you find the route that matters, measure it with a funnel.

What you will learn

  • Use a Sankey to discover routes and a funnel to measure one route's step rates
  • In the sample, an assumed four-step funnel held 400 of 1,590 bookings; 730 sessions it counted as lost still booked
  • Build the diagram from a step-prefixed source, target, value table and keep it to a few columns and nodes

What is a Sankey diagram, and when does it beat a funnel?

A Sankey diagram draws a set of flows as bands between nodes, with the width of each band proportional to the quantity moving along it. For website or app paths, the nodes are pages or events, the columns are steps, and the width is the number of sessions or people who went from one node to the next.

It beats a funnel when you do not yet know which route people take. A funnel asks one narrow question: of the people who did step A, how many then did B, then C? Everyone who took another route is counted as lost, even if they reached the goal. A Sankey draws all the common routes at once, so you can see the detours before you decide which route deserves a funnel.

Your questionBetter chartWhy
Where do people go after this page?SankeyThe destinations are unknown, so you cannot write funnel steps yet
How many complete these four steps, in order?FunnelStep rates need a fixed sequence and a clear denominator
What did people do just before signing up?Sankey read backwardThe end is fixed and the routes into it are not
Did step 3 improve after the redesign?Funnel with a comparison periodYou are tracking one rate over time
Which exact routes produced the most orders?Ranked path tableExact counts per full route are hard to trace through bands

The short version for a team meeting: use the Sankey to find routes and the funnel to measure one of them. The rest of this page proves that on one set of sample data, shows how to build the diagram from a path table, and marks where it stops being readable.

ViewBest questionWhat it hides
Sankey diagramWhich routes do people actually take?Exact totals per full route, time between steps
FunnelWhat share completes this fixed sequence?Every other route, even ones that reach the goal
Ranked path tableExactly how many took each full route?The overall shape of branching and merging
Backward SankeyWhat happened just before the goal?People who never reached the goal

One dataset can feed all four; pick by the question, not by which chart looks richer.

How do you read the nodes, bands and columns?

Four rules cover almost every user-path Sankey.

  1. Columns are order, not time. The left column is step 1, the next column is step 2, and so on. Two bands of equal length may represent a 3-second hop and a 3-day gap.
  2. Node height is volume at that step. The same page can appear in several columns. "Pricing as step 2" and "Pricing as step 3" are different nodes with different numbers.
  3. Band width is the number that took that hop. Compare widths, not lengths or slopes. A steep band is not a worse one; it only connects two nodes that sit far apart vertically.
  4. Flow should be conserved. What enters an intermediate node must either leave it for another node or exit. If 1,600 sessions reach Pricing at step 2, the bands out of that node, including exit, must add to 1,600.

The EU's data visualisation guide describes the underlying structure as a directed, weighted graph: each edge runs from a source node to a target node and carries a value. It also notes that many modern Sankey diagrams only allow flow in one direction, which is why path diagrams label nodes by step instead of drawing loops back to an earlier page.

One more reading rule comes from the data rather than the drawing: a node's number is only as clean as the definition of the node. If /courses/spanish and /courses/french are separate nodes, "Courses" never appears as a large block, and the diagram suggests that nobody looks at courses.

How do a Sankey and a funnel read the same 8,000 sessions?

Sample data: a language school's website recorded 8,000 sessions that started on the home page. The goal is a booked trial lesson. The school's team has assumed the route is Home → Courses → Pricing → Book trial.

Build that funnel with steps required in order (other pages allowed in between) and it reads like this:

Funnel stepSessionsRate from previous step
Home8,000—
Courses3,76047.0%
Pricing, after Courses1,12029.8%
Book trial, after Pricing40035.7%

The funnel says 400 of 8,000 sessions, or 5.0%, completed it. A reader would conclude that the leak is between Courses and Pricing, where 2,640 sessions disappear.

Now count every session that ended in a booking, whatever the route: 1,590, or 19.9% of 8,000. The assumed route accounts for 400 of them, which is 25.2%. And of the 2,640 sessions the funnel marked as lost after Courses, 730 booked a trial anyway (27.7%). They went from Courses straight to booking, through the Teachers page, or had visited Pricing before Courses.

Route to a bookingBookingsShare of 1,590
Home → Courses → Pricing → Book40025.2%
Home → Pricing → Book40025.2%
Home → Courses → Teachers → Book34021.4%
Home → Courses → Book32020.1%
Five other routes combined1308.2%

A Sankey of the same sessions shows a wide Courses → Teachers band (960 sessions) that the funnel had no step for. That is the finding worth a meeting: the Teachers page is part of the buying route, and "send more people from Courses to Pricing" may be the wrong brief. The funnel was not wrong. It answered the question it was given, and the question assumed the route. The types of funnels guide covers how ordering settings change those counts further.

app.tapcub.com

1,590 bookings by route

sample sessions
Home → Courses → Pricing → Book (the assumed funnel)400
Home → Pricing → Book400
Home → Courses → Teachers → Book340
Home → Courses → Book320
Five other routes130
Sample data
Sample data: a language school's 8,000 home-page sessions. The funnel the team assumed carries about a quarter of the bookings.

What goes into the path table?

Do not start in a charting tool. Start with a table that has one row per distinct route and a count. This is the sample's full table, cut at three steps after the home page; exit means the session ended there.

Route after HomeSessionsBooked
exit2,400no
Courses → Pricing → Book400yes
Courses → Pricing → exit720no
Courses → Book320yes
Courses → Teachers → Book340yes
Courses → Teachers → exit620no
Courses → exit800no
Pricing → Book400yes
Pricing → Courses → Book50yes
Pricing → Courses → exit310no
Pricing → Teachers → Book40yes
Pricing → Teachers → exit80no
Pricing → exit720no
Blog → Courses → Book20yes
Blog → Courses → exit180no
Blog → Pricing → Book20yes
Blog → Pricing → exit60no
Blog → exit520no

The 18 rows add up to 8,000. Check that before anything else: if the rows do not add to the number of sessions you started with, the diagram will be wrong in a way that is hard to see once it is drawn.

Three decisions shape this table, and each one changes the picture:

  • Unit. Sessions or people. One person with three visits is three routes by session and one longer route by person. Never mix units in one diagram.
  • Node definition. Page paths, page groups or events. Merge URL variants (language, ID, query string) before counting.
  • Repeats. A reload or a back-and-forth on the same page usually should collapse into one step.

How do you build a Sankey diagram from that table?

A Sankey tool needs a link list, not a route list. Google Charts, for example, expects three columns: source, destination and a numeric value that sets the link width. Turn the routes into links like this:

  1. Prefix every node with its step number. "2. Courses" and "3. Courses" must be different names. This also prevents loops: Google's documentation warns that a chain looping back to its starting node stops the chart from rendering.
  2. Cut each route into hops. The route Home → Pricing → Courses → Book becomes three links: 1. Home → 2. Pricing, 2. Pricing → 3. Courses, 3. Courses → 4. Book.
  3. Add an exit link from each non-goal node for sessions that went no further.
  4. Sum identical links across routes. In a spreadsheet, a SUMIFS over source and target does it.
  5. Check conservation at every intermediate node: total in equals total out.

If your pageviews are in a database, the window functions ROW_NUMBER() and LEAD() do steps 1 to 4 in one query. LEAD() returns the value from the next row in the same session, or null if there is none, which becomes the exit.

WITH ordered AS (
  SELECT session_id, page,
         ROW_NUMBER() OVER (PARTITION BY session_id ORDER BY viewed_at) AS step
  FROM pageviews
),
paired AS (
  SELECT step, page,
         LEAD(page) OVER (PARTITION BY session_id ORDER BY step) AS next_page
  FROM ordered
)
SELECT step || '. ' || page AS source,
       (step + 1) || '. ' || COALESCE(next_page, '(exit)') AS target,
       COUNT(*) AS sessions
FROM paired
WHERE step <= 3 AND page <> 'Book trial'
GROUP BY 1, 2
ORDER BY 1, 3 DESC;

The query treats Book trial as a terminal node, so it draws no exit after a booking. It assumes consecutive repeats were already removed. Run on a table generated from the 18 routes above, it returns 21 links. The ones leaving step 2 are:

SourceTargetSessions
2. Courses3. Pricing1,120
2. Courses3. Teachers960
2. Courses3. Book trial320
2. Courses3. (exit)800
2. Pricing3. Book trial400
2. Pricing3. Courses360
2. Pricing3. Teachers120
2. Pricing3. (exit)720
2. Blog3. Courses200
2. Blog3. Pricing80
2. Blog3. (exit)520

The Courses rows add to 3,200, Pricing to 1,600 and Blog to 800, matching the sessions that arrived at each of those nodes. When you draw it, order the nodes in each column by volume, put exit at the bottom in a neutral grey, and color the bands that lead to the goal, so the eye has one thing to follow.

Where does a Sankey stop being readable?

The number of possible bands grows much faster than the number of pages. With 8 named nodes plus an "other" block in each column, and an exit block in the next one, a single gap between columns can hold 9 × 10 = 90 bands. A five-step diagram has four gaps, so up to 360. Nobody reads 360 bands.

Pixels run out too. If the first column's 8,000 sessions fill 600 pixels of height, one session is 0.075 pixels and a route taken by 20 sessions is a 1.5-pixel hairline. It is on the chart, and it is invisible.

These limits are our working rules for a diagram that someone has to read on one screen:

SymptomWhat to change
The "other" block is the biggest thing in a columnMerge similar URLs into groups before raising the node limit
Bands cross so much that you cannot follow oneCut to 3 or 4 steps, or anchor on one start or end page
Most interesting routes are hairlinesFilter to one entry page or one segment and redraw
The same page repeats in every columnCollapse repeats, or switch the nodes from pages to events
Readers ask for the exact number on a bandPut the ranked path table next to the diagram
You want to compare two periodsUse two funnels or a table; two Sankeys side by side are hard to compare

A Sankey also cannot show time between steps, statistical uncertainty, or why anyone moved. And the totals at each column shrink as people exit, so a narrow band in step 4 may still be a large share of those who got that far. State which denominator you mean when you quote a percentage.

What can you safely conclude from the picture?

Nielsen Norman Group's guidance on pathway reports is blunt about the main limit: they aggregate people with different intentions, so two visitors with identical paths can have had very different experiences. Someone who left a search page frustrated looks the same as someone who found the answer and left.

So read in this order, and stop at the level your evidence supports:

  1. Size the exits. In the sample, 2,400 of 8,000 sessions (30%) end on the home page. That is a fact about the data.
  2. Follow the widest bands to the goal. Four routes carry 1,460 of 1,590 bookings (91.8%). Also a fact.
  3. Name the unexpected route. Courses → Teachers → Book carries 340 bookings. This is a lead, not a cause: people who open teacher profiles may simply be more serious already.
  4. Turn the lead into a funnel. Build Courses → Teachers → Book and watch its step rates weekly.
  5. Test before crediting the page. If the Teachers link is promoted and bookings do not move, the page was a marker of intent, not the reason for it.

For a closer look at individual sequences behind a band, clickstream analysis reads raw click order row by row.

How do you draw this in TapCub?

The language school's question, "where do people go after the home page, and which routes end in a booking," maps onto TapCub's path report, whose result is drawn as a Sankey diagram. The pages or events need to be tracked already.

  1. Open All-platform analytics › Behavior › Paths. Choose pages as the node type, direction forward from a start, and set the start anchor to the home page. Steps run from 2 to 10 (default 5); each step keeps 3 to 15 nodes (default 8) and folds the rest into "(other)".
  2. Counting defaults to sessions, which matches the sample. Leave Collapse repeats on, and add a clean-up rule that rewrites every course URL into one label; up to 10 rules are allowed.
  3. Read the columns. Forward paths show a dark "(exit)" block for sessions with no further step, and the line under the chart lists the exits per step. Hovering a node highlights only its bands.
  4. Switch the direction to backward from an end, set the end anchor to the booking event and use pages plus events as nodes. Now the right-hand column is the booking and the columns to its left show what preceded it.
  5. Click the Courses → Teachers band to View users or Create segment, then build the three-step funnel for that route and follow its step rates.

Export gives you source, target and count, which is the link list from the build section. Limits to keep in mind: at most 50,000 transitions are kept before the per-step trim, so long-tail routes drop first; there is no breakdown or comparison period in this report; and drop-off is only drawn going forward. The how-to is in analyze user paths, and funnel versus goal versus path helps you pick the report. For the concept behind it, see user path analysis.

FAQ

What is a Sankey diagram used for?

It shows how a quantity splits and merges as it moves between stages. The classic uses are energy, material and cost flows. In web and product analytics it shows which pages or events people move between, where routes branch, and where sessions end without a next step.

Is a Sankey diagram better than a funnel chart?

Neither is better in general. Use a Sankey when routes are unknown or branch a lot, and a funnel when the sequence is fixed and you need a conversion rate per step. A practical order is to find the common routes with the Sankey, then measure the one you care about with a funnel.

How do I make a Sankey diagram from a spreadsheet?

Create three columns: source, target and value. Prefix node names with the step number, add exit rows for sessions that stop, and sum identical pairs with SUMIFS. Check that inflow equals outflow at every middle node, then load the three columns into a charting tool that supports Sankey charts.

Why does my Sankey chart fail to render or show loops?

Usually because the same node name appears upstream and downstream, which creates a cycle. Some libraries, including Google Charts, will not draw data with cycles. Name nodes by step, for example "2. Courses" and "3. Courses", so every link moves one column to the right.

How many nodes should a Sankey diagram have?

There is no standard. As a working rule, keep it to about 3 to 5 steps and under 10 named nodes per column, with the remainder grouped as "other". If "other" dominates, clean up the node definitions first; if bands become hairlines, filter to one entry page or segment.

What is the difference between a Sankey diagram and an alluvial diagram?

The line is blurry, as the EU data visualisation guide puts it. Alluvial diagrams are mainly used to show how data is distributed across several categories, or how membership changes between time points. A Sankey emphasizes weighted flow through a directed network of nodes.

Sources

Filed underAnalytics

Was this article helpful?

We use your answers to fix and expand this page.

Lin Zhou

Product Experience Specialist

Writes about product experience, practical workflows, and growth, turning complex processes into clear steps for everyday decisions.

See where people go after your key pages

Path analysis with a Sankey view, exits per step, and funnels for the routes worth measuring.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics