Skip to main content
Segment is plumbing: it routes traits and events to your warehouse, BI tool, and engagement platform. It doesn’t tell you why one person dropped or errored — the number lives downstream, in Looker or Engage, and it can’t replay what the user actually saw. Subtext can. Attach the Subtext session URL to your Segment traits and events and it travels with every user and event into those downstream tools — your agent reads the subtext_url, opens that person’s real session, and walks the decisive moments with screenshots, the component tree, network, and console. Your warehouse and audiences detect; Subtext diagnoses.
This guide assumes the Subtext capture snippet is installed and capturing sessions, and Segment Analytics.js (analytics.js or @segment/analytics-next) is initialized.

Attach the session URL

Store the current Subtext session URL on your Segment data so it travels with every trait and event into your warehouse and downstream tools. There are two places to attach it, depending on how precise the link needs to be.

On the user profile

Attach the URL to the Segment user profile via analytics.identify. Call it wherever your app already identifies the user — on auth resolution, not at module top level. Segment accepts any trait key, so use subtext_url; the warehouse connector snake_cases column names anyway, so it lands as subtext_url there.

On every event

Segment source middleware runs on every call, letting you attach the URL fresh per event. Because url.now carries a timestamp, the link deep-links to the moment each event fired. Register the middleware once at app initialization, before any track calls.
Don’t read FS('getSession') at module top level — it returns null until the session has started. Don’t switch the key mid-stream: use subtext_url across both identify and track, since lookups and filters are case-sensitive and a mismatched key won’t be found. And don’t register the middleware inside a component render — register it once at the analytics initialization point. The session URL changes on a new session and when FS('setIdentity') is called with a different uid, so if your app calls analytics.identify on every auth state change, the user-level linkage stays current automatically; the source middleware reads the URL fresh on every event, so it never needs re-attaching.

From signal to session

Segment is plumbing, so you never hear about a problem in Segment — you hear about it in a downstream surface: a warehouse dashboard, a computed audience, a data-quality alert. However it reaches you, the path is the same: get to the subtext_url, then hand it to your agent for a Detect-vs-Diagnose read. The data says this user dropped or errored; the session shows what they actually experienced.
The analyst or growth PM reviewing the weekly funnel in Looker, Mode, or Hex sees the checkout funnel — built on Segment events in the warehouse — converting below trend.Query the event table for the affected users’ sessions:
Grab a few, then hand them to your agent:
The lifecycle or CRM owner sees a user land in a computed audience like Started checkout, no purchase in 24h in Twilio Engage (or a connected tool), and wants to know why before triggering a win-back.Open the user’s profile in Segment, go to Traits, and copy subtext_url.
The data engineer who owns tracking quality gets a Segment Protocols violation — a key event firing with malformed or missing properties, suggesting a broken client.Find a recent offending event in the source debugger or warehouse; if it carries subtext_url, copy it.
For a funnel investigation across several users, ask your agent to consolidate the findings into one proof document (doc-create) — a screenshot per dropped user and a single shareable link — then drop it into the dashboard annotation, Engage profile note, or data-quality ticket so the next person sees the human story behind the number. And if the review shows the drop was a deliberate user choice rather than a bug, say so: that redirects effort toward messaging or pricing instead of engineering.

For agents

An autonomous agent can run the whole loop against Segment directly: discover the friction, extract the subtext_url, and hand each session to the Subtext MCP. There is no official Segment CDP data MCP — don’t assume one exists. The only Segment-related MCP is the Twilio MCP (mcp.twilio.com/docs), a read-only documentation index whose twilio__search and twilio__retrieve tools return API specs and schemas; it helps you find the right Segment endpoint but can’t read a trait or query an audience. The practical stance is to call Segment’s REST and warehouse directly, optionally using the Twilio docs MCP to look up exact request shapes.
1

Discover the friction

Segment has no native funnel API — it’s plumbing, not an analytics product. Compute drop-offs with warehouse SQL over the warehouse tracks tables:
Or surface at-risk segments with computed and predictive traits via the Profile API (?class=computed_trait, ?class=audience).
2

Extract the session URL

Read subtext_url per user from the Profile API:
include=subtext_url returns just that trait (default page size is 10 traits; ?limit=200 max). This is server-side only — no CORS. For event-level, moment-linked URLs, query the subtext_url column on the event-specific table (e.g. segment.<source>.checkout_started) instead — custom Track properties land as un-prefixed columns on <source>.<event> tables, not on tracks.
3

Hand off to Subtext

For each URL, call review-open(session_url=<subtext_url>) on the Subtext MCP, step through the drop, and return a Detect-vs-Diagnose read: the warehouse says they dropped, the session shows what they experienced.
subtext_url only round-trips if it was attached as a user trait or event property at capture time (see Attach the session URL). Match your region for the API host (profiles.segment.com vs profiles.euw1.segment.com). Event-level links from the warehouse event tables are moment-precise; user-trait links open at session start.