Overview
Sparklytics provides real-time analytics that update every 10 seconds, giving you instant visibility into current visitor activity on your website. The real-time dashboard shows active visitors and recent pageviews without requiring cookies or client-side storage.Active Visitors
The real-time panel displays the current number of active visitors on your site. A visitor is considered active if they’ve triggered any event (pageview or custom event) within the last 30 minutes.
How It Works
- 30-minute activity window: Visitors are counted as active if they’ve had any activity in the last 30 minutes
- Server-side tracking: No client-side polling required — activity is tracked server-side
- Privacy-first: Uses privacy-preserving visitor IDs computed as
sha256(salt_epoch + ip + user_agent)[0:16] - Auto-refresh: Dashboard polls the real-time endpoint every 10 seconds
Recent Events Stream
The real-time panel shows the last 100 events from the past 30 minutes, ordered by most recent first.Event Information
Each recent event displays:- URL: The page path or event name
- Referrer domain: Where the visitor came from (if available)
- Timestamp: Relative time (e.g., “2m ago”, ”15s ago”)
API Reference
The real-time data is powered by the/api/websites/:id/realtime endpoint.
Endpoint
Query Parameters
Include bot traffic in the results. Defaults to the website’s bot policy setting.
Response
Implementation
Fromcrates/sparklytics-server/src/routes/realtime.rs:18:
Dashboard Integration
The real-time panel automatically updates in the background while you view your analytics dashboard.Live Indicator
The pulsing green dot indicates that the real-time data is being actively refreshed:Polling Strategy
Fromdashboard/components/dashboard/RealtimePanel.tsx:18:
- Fetches data every 10 seconds using React Query
- Gracefully handles API errors
- Shows skeleton loading states during initial fetch
Use Cases
Monitor Campaign Launch
Watch visitor activity in real-time as you launch a marketing campaign or product announcement.Track Event Impact
See immediate traffic spikes from social media posts, email campaigns, or PR coverage.Debug Tracking Issues
Verify that events are being tracked correctly by watching the recent events stream as you navigate your site.Support Live Events
Monitor concurrent users during webinars, product launches, or flash sales.Performance
The realtime endpoint is optimized for fast queries:- DuckDB: Queries complete in < 10ms for sites with millions of events
- ClickHouse (Cloud): Queries complete in < 5ms with horizontal scaling
- No polling overhead: Server handles all computation; clients simply fetch results
Privacy & Compliance
- No cookies: Real-time tracking works without storing any client-side state
- IP anonymization: Visitor IDs are one-way hashes that rotate daily at midnight UTC
- GDPR-friendly: No PII is stored or transmitted
- DNT/GPC respected: Honors Do Not Track and Global Privacy Control signals by default
Next Steps
Custom Events
Track custom events in the real-time stream
Sessions
View detailed session timelines