Open any analytics dashboard and you'll see a number: cart abandonment rate, 68%. Or 72%. Or 81%. The number is huge, the chart is red, and you have no idea what to do about it.
The reason is simple: dashboards measure outcomes, not causes. They tell you what happened — visitors abandoned — without a single signal about why. So you guess. You discount. You retarget. You A/B test the button color. You burn months running experiments with no theory of the case.
AI session insights are designed to fix exactly that. Instead of telling you the abandonment rate, they tell you the abandonment reason, per session, with a narrative explanation and a suggested action. Here's how it works.
The Pipeline: From Event Stream to Reason
Every visitor session leaves a trail. Page views, clicks, scroll depth, form focus events, errors, time stamps. A modern behavioral SDK captures roughly 50–200 events per session and ships them to a backend in batches.
That event stream is rich enough that a human, given enough time, could read it and tell you why each visitor left. The problem is volume. If you have 5,000 sessions a day, no human is reading them.
An AI session insights pipeline does the reading for you. The flow:
- Session ends — visitor closes the tab, navigates away, or hits a quiet-for-1-hour timeout.
- Pipeline branches on outcome —
convertedAt IS NULL→ abandonment analysis.convertedAt IS NOT NULL→ conversion analysis. - Event timeline assembled — chronologically ordered list of every event, with element selectors and URLs.
- LLM prompt — the timeline plus DOM context goes to a language model with a structured-output schema.
- Result cached — structured reason + confidence + narrative + suggested actions, persisted per session.
The output is a discriminated union: every session gets either a kind: "abandoned" insight or a kind: "converted" insight, with one reason from a fixed taxonomy and a free-text explanation.
The 7 Abandonment Reasons
The taxonomy isn't arbitrary — it's the set of behaviors that actually distinguish failed sessions in the wild. Here's what each one looks like, with the narrative an AI might generate and the action it would suggest.
"Visitor lingered on the pricing page for 4 minutes, scrolled the comparison table 3 times, opened a second tab (likely a competitor), came back, hovered the 'Buy' button without clicking, then left."
Suggested action: Send a 24-hour discount code with a clear value-comparison narrative, not just "10% off."
"Visitor filled in 4 of 6 signup fields, then rage-clicked the submit button 3 times. The button only fired on the third click. They abandoned 8 seconds later."
Suggested action: Fix the click handler bug. Send a recovery email with the form pre-filled from the captured data.
"Visitor reached the checkout page, then navigated to /privacy and /terms, spent 90 seconds reading both, returned to checkout, and bounced."
Suggested action: Add visible trust signals near the payment form — security badges, money-back guarantee, support contact.
"Visitor arrived from a Google search for 'swiftmail vs klaviyo,' bounced after 12 seconds on the homepage. Two more sessions same day, one from Reddit, one from a review site."
Suggested action: Show a contextual popup with a head-to-head comparison page, or trigger a Reddit retargeting ad.
"Visitor opened the product page, tab went hidden after 30 seconds, came back 18 minutes later, scrolled briefly, left. No engagement signals during the gap."
Suggested action: Send an email 1 hour later with the product they looked at and a "still thinking?" subject line.
"Visitor clicked 'Add to cart,' the API returned a 500 error, the cart icon never updated. They tried twice more, then left. fetch_error events fired at 12:04:33, 12:04:51, 12:05:02."
Suggested action: Auto-create an engineering ticket with the stack trace. Send a recovery email once the bug is confirmed fixed.
"Insufficient signal — visitor had a 6-second session with one page view and no other events."
Suggested action: Don't trigger anything. Optimize landing page load time and first-impression copy instead.
Notice the suggested actions. They're different per reason. The discount code that recovers a price-hesitator does nothing for someone who hit a runtime error. The trust signals that win over a hesitant checkout visitor are wasted on a comparison shopper. Treating all abandonments the same is the single biggest leak in most ecommerce funnels.
The 6 Conversion Reasons
The same model runs on converted sessions too — and that's arguably more valuable. If you understand why someone converted, you know what to amplify, not just what to fix.
Value fit— product/price matched the need; straight browse-to-buy with minimal frictionUrgency— time-limited signal preceded the click (promo code, low-stock indicator, countdown)Social proof— scrolled to reviews/testimonials/counts before convertingClear CTA— short funnel, direct path: landing → product → buy; no detoursReturning intent— multi-session research, decision window closed; branded or direct referrerRecommendation match— arrived via email/push/retargeting campaign, landed on the recommended item
If 60% of your conversions are Social proof, you should be putting more reviews higher on the page. If 40% are Returning intent, your job is to support multi-session decision-making with email nurture, not to push a hard CTA. The reason-mix tells you what your customers actually need from you.
How the Model Avoids Hallucinating
The natural objection: LLMs make things up. How do you trust a model to tell you the truth about why a visitor abandoned?
Three architectural choices keep the system honest:
1. Structured output, not free-text. The model isn't asked "what happened?" It's asked to pick one of seven abandonment reasons (or six conversion reasons) and produce a confidence score. Even if the narrative is loose, the categorical decision is bounded.
2. Confidence scores, surfaced. Every insight ships with a confidence value. Low-confidence outputs (sparse signals, weird sessions) are flagged as Unclear rather than guessed. The model is allowed to say "I don't know."
3. Suggested actions are bounded. The action set is a fixed taxonomy: Send recovery email, Tag customer, Add to segment, Trigger retargeting, Create engineering ticket, etc. The model can't invent actions, only choose from the registry. So even when the narrative is creative, the downstream behavior is predictable.
The combination — structured taxonomy + confidence + bounded actions — is what makes session insights production-safe rather than a fancy chatbot.
From Per-Session to Aggregate Patterns
Per-session insights are one half. The other half is aggregating across sessions to surface patterns.
Run the same model over 50 sessions in the past hour, weighted by recency, and you can ask: "What's the dominant abandonment reason on the /pricing page right now?" Answer: maybe Price hesitation jumped from 12% to 41% after you raised prices last Tuesday. That's an aggregate insight — a pattern across sessions, with a narrative ("a noticeable share of visitors are hesitating after the price increase, particularly on the Growth tier"), and a suggested aggregate action ("test a value-stack section above the pricing table").
This is where behavioral AI moves from a debugging tool to a strategic one. You stop reading individual sessions and start reading the system. Same way doctors moved from diagnosing patients to interpreting epidemiology.
What This Means for Marketing Operations
If you've been running marketing on 4 signals (opens, clicks, page views, purchases) and assigning one generic recovery flow to every abandoner, you're leaving real money on the table. The conversion uplift from differentiated, reason-aware recovery is large — double-digit percentage in most studies.
The catch is that you need three things to make it work:
- Behavioral SDK — capturing the 12 signals (see our breakdown of the 12 signals)
- AI insights layer — running the structured-output classification on each session
- Channel adapters — the ability to trigger different actions (email, SMS, popup, retargeting, CRM task) based on which reason fired
All three need to live in the same system, with a fast trigger path between them. Bolting Hotjar onto Klaviyo doesn't work — the data formats don't match, the signals are time-shifted, and you can't fire a Klaviyo flow from a Hotjar event without a brittle middleware layer.
What SwiftMail Does Here
SwiftMail is AI marketing automation for small business that runs the full pipeline natively: @swiftmail/sdk-web captures the 12 signals (~4.4KB gzipped), the insights service runs a structured-output prompt against each session and writes the result to a SessionInsight table, and the Flow Builder triggers email/SMS/push/popup adapters based on the resulting reason. From $20/mo — full pipeline, no integration glue.
The Real Win
The cliché in conversion optimization is "you can't improve what you can't measure." It's almost true. The actual rule is: you can't improve what you can't explain. Measuring abandonment rate doesn't help. Measuring why abandonment happened — with structured reasons, narratives, and suggested actions — turns the funnel from a black box into a debuggable system.
That's the shift AI session insights enable. Less guessing. Less generic recovery flows. More precision per visitor. And, eventually, fewer abandoned sessions to recover — because you actually fixed the reasons.
AI marketing automation that knows the reason.
SwiftMail runs AI insights on every session, then triggers email, SMS, push, or popups based on the reason. AI marketing automation for small business — from $20/mo.
Get Early Access