Telemetry
Product analytics SQL recipe

Measure Product Journey Drop-Off by Session

Measure how many sessions reach each ordered product milestone and calculate both journey completion and step-to-step conversion.

Intermediateproduct_journey_eventsReviewed 2026-07-28Tested with Apache DataFusion 45.2.0

Reviewed by the Telemetry product team on . SQL compatibility, event contract, synthetic output, and operational caveats. Editorial ownership

Question answered

Where do sessions leave the path from landing page to first query?

A journey report needs one counting unit and an explicit step order. This reproducible pattern counts sessions at each milestone, compares every step with the first, and separately shows conversion from the immediately preceding step.

Event contract

Fields the query expects

FieldTypeWhy it exists
timestamp_utcTimestampMilestone time in UTC.
session_idUtf8Approved session identifier shared by journey events.
step_nameUtf8Controlled journey milestone.
step_orderInt64Stable one-based milestone order.
acquisition_sourceUtf8Bounded acquisition source.
environmentUtf8Deployment environment.
DataFusion SQL

Copy the query

sql
WITH step_counts AS (
  SELECT
    step_order,
    step_name,
    COUNT(*) AS sessions_reached
  FROM product_journey_events
  WHERE timestamp_utc >= now() - INTERVAL '30 days'
    AND environment = 'production'
  GROUP BY step_order, step_name
)
SELECT
  step_order,
  step_name,
  sessions_reached,
  100.0 * sessions_reached
    / NULLIF(FIRST_VALUE(sessions_reached) OVER (ORDER BY step_order), 0)
    AS journey_completion_pct,
  100.0 * sessions_reached
    / NULLIF(COALESCE(LAG(sessions_reached) OVER (ORDER BY step_order), sessions_reached), 0)
    AS step_to_step_pct
FROM step_counts
ORDER BY step_order;

This read-only query is planned and executed against an empty typed table with Apache DataFusion 45.2.0. The deterministic sample output is synthetic and reviewed separately; validate field types, thresholds, and business definitions against your own data. Read the testing methodology.

Query result

Session journey completion

Two of five synthetic sessions reach the first-query milestone.

step_orderstep_namesessions_reachedjourney_completion_pctstep_to_step_pct
1landing_viewed5100100
2signup_completed48080
3workspace_created36075
4first_query_run24066.67

Synthetic example output. Run the query against your own event schema and thresholds before using it for operational decisions.

Session journey completion: static chart of synthetic sessions_reached values from the Measure Product Journey Drop-Off by Session example result
Indexable SVG of the deterministic example output. Download it for an article, runbook, or design review with attribution.

Reproduce the example

Download the public fixture

The JSON bundle includes the typed event contract, reproducible input rows, exact SQL, expected output, review notes, and engine version. The CSV contains the displayed result.

How the SQL works

  1. 1The session is the explicit counting unit; replace it with user or account only when that matches the decision.
  2. 2Journey completion compares each step with entry while step-to-step conversion isolates the immediate transition.
  3. 3A controlled step order prevents timestamps or labels from silently rearranging the funnel.

Edge cases to decide

  • Deduplicate repeated milestone events per session before using this pattern on noisy producers.
  • Choose whether steps must occur in order and within one session; stricter funnels need per-session sequencing.
  • Keep anonymous-to-authenticated identity stitching documented and privacy-reviewed.

Recommended dashboard

  • Funnel: sessions_reached by step_name
  • Bars: step_to_step_pct by acquisition source
  • Trend: first_query_run completion by signup week

Alert guidance

Use a release comparison or sustained baseline change rather than alerting on a single low-volume session bucket.

Read alert setup

Put the recipe to work

Related instrumentation and guides

Continue the analysis

Run it on real events

Create a table, adapt the fields, and save the result

Start free, send structured events, and use the query result as a chart, shared dashboard widget, or alert input.

Get an API key