Overview
Journey Analysis reveals the paths users take through your site by showing what happens before or after a specific page or event (the “anchor”). Unlike funnels (which require predefined steps), journey analysis discovers actual user behavior patterns from your data.
How It Works
Anchor-Based Exploration
Pick an anchor point (page or event), then explore paths in either direction:- Next: What do users do after visiting this page?
- Previous: What do users do before visiting this page?
Example: Next Journey
Anchor:/pricing (page)
Result:
Example: Previous Journey
Anchor:signup_complete (event)
Result:
API Reference
Endpoint
Query Parameters
Type of anchor:
page or eventThe page path (e.g.,
/pricing) or event name (e.g., signup_complete). Maximum 500 characters.Direction to explore:
next or previousHow many levels to traverse (1-5)
Start date in
YYYY-MM-DD formatEnd date in
YYYY-MM-DD formatExample Request
Response
Response Fields
Total visitors who interacted with the anchor in the date range
Number of unique visitors who took this path
Percentage of anchor visitors who took this path (visitors / total_visitors × 100)
Nested paths at the next depth level (recursive structure)
Direction Modes
Next (Forward)
Shows what users do after the anchor. Use cases:- Landing page optimization: Where do users go after landing?
- Content discovery: What do readers explore next?
- Conversion paths: What pages lead to signup/purchase?
Previous (Backward)
Shows what users did before the anchor. Use cases:- Attribution: How did users discover this feature?
- Funnel analysis: What paths lead to conversion?
- Entry point analysis: Where do successful users start?
Depth Levels
Control how many steps to explore:- Depth 1
- Depth 3 (default)
- Depth 5 (max)
crates/sparklytics-server/src/routes/journey.rs:21:
Validation Rules
Anchor Type
Fromcrates/sparklytics-server/src/routes/journey.rs:49:
Anchor Value
- Required: Cannot be empty
- Maximum length: 500 characters
- Trimmed: Leading/trailing whitespace removed
Filtering Journey Data
Apply standard filters to analyze journeys for specific segments:Available Filters
filter_countryfilter_regionfilter_cityfilter_browserfilter_osfilter_devicefilter_utm_sourcefilter_utm_mediumfilter_utm_campaign
Performance & Rate Limiting
Journey queries are computationally expensive and rate-limited:429 Too Many Requests.
Optimization Tips
- Reduce max_depth: Depth 5 is much slower than depth 2
- Narrow date range: Shorter ranges = faster queries
- Add filters: Reduce dataset size before computing paths
- Cache results: Journey data changes slowly — cache for 5-10 minutes
Dashboard Visualization
The journey UI provides an interactive tree view:Controls
Fromdashboard/components/journey/JourneyControls.tsx:
- Anchor type selector: Page or Event
- Anchor value input: Free text or dropdown of popular pages/events
- Direction toggle: Next or Previous
- Depth slider: 1-5 levels
Branch List
Each branch row shows:Use Cases
Landing Page Optimization
Find out where users go after landing on key pages:Feature Discovery
See how users discover a feature:Content Recommendations
Identify related content users explore together:Conversion Attribution
Trace the path users take before converting:Drop-Off Analysis
Find where users exit after visiting a page:Best Practices
Start with Depth 2-3
Deeper paths take longer to compute and are harder to interpret:Use Specific Anchors
Page paths are more actionable than event names:Combine with Filters
Segment journeys by device or traffic source:Iterate with Pivot
Use the “Explore from here” feature to drill deeper:- Start:
/pricing→ next - Find: Most users go to
/signup - Pivot:
/signup→ next - Find: Most users go to
/onboarding - Optimize: Improve the
/onboardingexperience
Common Patterns
Loop Detection
Users may revisit the same page:Mixed Page + Event Paths
Journeys can include both pages and events:Dead Ends
Branches with no children indicate exits:Troubleshooting
”No data found”
If the response has no branches:- Anchor doesn’t exist in the date range
- Typo in
anchor_value - Filters too restrictive
- Verify the anchor exists in your data
- Check spelling (case-sensitive)
- Remove filters temporarily
”Rate limited”
HTTP 429 response:- Too many concurrent journey queries
- Semaphore queue full
- Wait 5 seconds and retry
- Reduce
max_depthto speed up queries - Cache results on the client side
Next Steps
Funnels
Define specific conversion paths to track
Sessions
View individual user session timelines