Analytics & Observability
Temps includes a comprehensive analytics and observability platform built-in—no external services required. Track visitors, replay sessions, monitor performance, and analyze user behavior all in one place.
Overview
Unlike Vercel and other platforms that require third-party integrations, Temps provides production-ready analytics out of the box:
What's Included
- Real-time visitor analytics
- Custom event tracking
- Session replay with DOM recording
- Core Web Vitals monitoring
- Funnel analysis
- Geographic tracking
- User session stitching
- Performance metrics
Why It Matters
- Zero external dependencies
- No data leaves your infrastructure
- Page view capacity scales with your server
- Complete data ownership
- Designed for GDPR/CCPA compliance — see Privacy & Compliance
- Fast dashboard queries on typical hardware (see Architecture)
Architecture
Temps analytics is powered by:
- TimescaleDB: Time-series database for high-throughput event ingestion
- PostgreSQL: Hypertables for automatic data partitioning
- In-Memory Caching: Sub-100ms query performance
- Event Batching: Efficient network usage
Visitor Analytics
Track and analyze visitor behavior with detailed metrics and geographic data.
Metrics Tracked
- Name
Page Views- Description
Total page views with time-series charts, breakdown by path, referrer tracking
- Name
Unique Visitors- Description
IP-based unique visitor identification, session stitching, returning vs new visitor ratio
- Name
Session Duration- Description
Average session length, time on page, engagement metrics
- Name
Bounce Rate- Description
Single-page session tracking, exit page analysis
- Name
Geographic Data- Description
Country, region, city detection using MaxMind GeoIP, timezone tracking
- Name
Device & Browser- Description
User agent parsing, browser version, OS, device type (mobile/desktop/tablet)
- Name
Referrer Sources- Description
Traffic source tracking, UTM parameter parsing, campaign attribution
- Name
Real-Time Visitors- Description
Live visitor count, currently active pages
Dashboard Views
Access analytics data via the dashboard. View real-time metrics, historical trends, and detailed visitor insights all in one place.
Time-Series Charts
View trends over time with customizable date ranges:
- Last 24 hours (hourly breakdown)
- Last 7 days (daily breakdown)
- Last 30 days (daily breakdown)
- Last 90 days (weekly breakdown)
- Custom date range
Bot Filtering & Engagement
Temps filters out automated traffic so your metrics reflect real humans. Bot detection and engagement scoring are built-in and run automatically — there are no flags, environment variables, or endpoints to configure. The thresholds and pattern list below are fixed in source.
How a session counts as "engaged"
A session is marked engaged only if at least one of these is true:
- The visitor spent ≥ 10 seconds of measured wall-clock time on the site (
MAX(timestamp) − MIN(timestamp)across the session, orlast_accessed_at − started_atfor the per-session detail view), or - The visitor fired a genuine interaction event.
Auto-fired view events do not mark a session engaged on their own, because intersection observers fire them for bots too. The following are excluded from the interaction count:
| Event | Why it's excluded |
|---|---|
page_view | Auto-fired on every page load |
page_leave | Auto-fired when the page is left |
Any event name ending in _viewed (e.g. product_viewed) | Auto-fired by intersection observers when an element scrolls into view |
A session that only fires these view events still becomes engaged if it crosses the 10-second wall-clock threshold — that's the only way such a session counts.
Previously, any event other than page_view / page_leave flipped a session to engaged, which inflated engagement with bot-driven view events. The 10-second-or-interaction rule replaced that as of v0.1.0-beta.19.
Session replays exclude zero-duration sessions
Replay listings (both the count and the list) only include sessions whose recorded duration is greater than 0 ms. Sessions with a duration of 0 ms or NULL — never-finalized single-burst sessions, which are typically bots — are excluded, because they have nothing to play back.
User-agent bot detection
The events pipeline matches each visitor's user-agent string (case-insensitively, by substring) against a built-in list of 50+ known bot patterns. A match sets the event/visitor is_crawler flag and records the matched crawler_name. A missing or empty user-agent is also treated as a bot — real browsers always send one.
The pattern list covers:
| Category | Examples |
|---|---|
| AI crawlers | GPTBot, ClaudeBot, anthropic-ai, PerplexityBot, CCBot, Bytespider, Google-Extended, Applebot, Amazonbot |
| Search / SEO crawlers | Googlebot, Bingbot, YandexBot, DuckDuckBot, Baiduspider, AhrefsBot, SemrushBot |
| Link-preview unfurlers | facebookexternalhit, Slackbot, Discordbot, Twitterbot, LinkedInBot, WhatsApp, Telegrambot |
| Headless browsers / automation | HeadlessChrome, PhantomJS, Puppeteer, Playwright, Selenium |
| Monitoring tools | Pingdom, UptimeRobot, StatusCake |
| HTTP clients | python-requests, curl, wget, go-http-client, node-fetch, axios |
| Generic catch-alls | bot, crawler, spider |
This list is matched in addition to the underlying parser's own crawler classification; the substring match is the more specific signal and takes precedence.
Event Tracking
Track custom events to understand user interactions and behavior.
Built-in Events
Temps automatically tracks:
- Page views
- Page exits
- Link clicks (external)
- Form submissions
- File downloads
- 404 errors
- JavaScript errors
Custom Events
Track any custom event in your application:
Track Custom Events
import { useTrackEvent } from '@temps-sdk/react-analytics';
function CheckoutButton() {
const trackEvent = useTrackEvent();
const handleCheckout = () => {
trackEvent('checkout_completed', {
orderId: '12345',
amount: 99.99,
currency: 'USD',
items: 3
});
};
return <button onClick={handleCheckout}>Complete Purchase</button>;
}
Event Properties
- Name
Event Name- Description
String identifier for the event (e.g., 'signup_completed', 'video_played')
- Name
Properties- Description
Custom JSON object with event metadata (any structure)
- Name
User ID- Description
Optional user identifier to link events across sessions
- Name
Timestamp- Description
Automatic timestamp (or custom for backfilling)
- Name
Session ID- Description
Automatically generated session identifier
- Name
Context- Description
Automatic context (IP, user agent, referrer, page URL)
Querying Events
Query and filter events in the dashboard or via API:
Dashboard
// Filter events in dashboard
{
"event": "purchase_completed",
"dateRange": "last_30_days",
"filters": {
"properties.amount": { "gte": 100 },
"properties.currency": "USD"
},
"groupBy": "properties.plan"
}
Session Replay
Record and replay user sessions to understand how users interact with your application.
Features
- Name
DOM Recording- Description
Captures DOM snapshots and mutations, CSS styles, input events (with privacy controls)
- Name
Event Timeline- Description
Visual timeline of all interactions (clicks, scrolls, navigation, errors)
- Name
Console Logs- Description
Captures browser console output during session
- Name
Network Activity- Description
Records API requests and responses (optional)
- Name
Performance Metrics- Description
FPS, memory usage, page load times
- Name
Error Correlation- Description
Links sessions to error events for debugging
Privacy Controls
Automatic Redaction
- Password inputs (always masked)
- Credit card fields (always masked)
- Email addresses (configurable)
- Phone numbers (configurable)
- Custom selectors
User Consent
- Opt-in mode (user consent required)
- Opt-out mode (user can disable)
- Geo-based rules (GDPR compliance)
- Sampling rate (record % of sessions)
Configure Session Replay
import { TempsAnalyticsProvider } from '@temps-sdk/react-analytics';
function App() {
return (
<TempsAnalyticsProvider
enableSessionRecording={true}
sessionRecordingConfig={{
sessionSampleRate: 0.1, // Record 10% of sessions
maskAllInputs: false,
blockClass: 'sensitive-data',
maskTextSelector: 'input[type="password"], input[type="email"]'
}}
>
<YourApp />
</TempsAnalyticsProvider>
);
}
Replay Player
The replay player includes:
- Playback controls (play, pause, speed adjustment)
- Timeline scrubber
- Event markers (clicks, navigation, errors)
- Console panel
- Network panel
- Device viewport emulation
Storage Optimization: Session recordings are compressed using efficient algorithms. Average session (~5 minutes) uses ~500KB storage.
Performance Monitoring
Track Core Web Vitals and performance metrics to optimize user experience.
Core Web Vitals
- Name
Largest Contentful Paint (LCP)- Description
Measures loading performance. Target: < 2.5 seconds
- Name
Interaction to Next Paint (INP)- Description
Measures responsiveness. Target: < 200 milliseconds. Replaced FID as a Core Web Vital in March 2024.
- Name
Cumulative Layout Shift (CLS)- Description
Measures visual stability. Target: < 0.1
- Name
First Contentful Paint (FCP)- Description
Time to first content render. Target: < 1.8 seconds
- Name
Time to First Byte (TTFB)- Description
Server response time. Target: < 600 milliseconds
Automatic Collection
Performance metrics are automatically collected when you use the Temps SDK:
Enable Performance Monitoring
import { TempsAnalyticsProvider } from '@temps-sdk/react-analytics';
function App() {
return (
<TempsAnalyticsProvider
autoTrackSpeedAnalytics={true}
>
<YourApp />
</TempsAnalyticsProvider>
);
}
Performance Insights
View performance trends in the dashboard:
- Historical performance scores (Lighthouse-style)
- Performance by page/route
- Performance by device/browser
- Performance by geography
- Percentile distributions (P50, P75, P95, P99)
Performance Budgets
Set performance budgets and get alerts when exceeded:
// Configure performance budgets
{
"budgets": {
"LCP": { "target": 2500, "alert": 4000 },
"INP": { "target": 200, "alert": 500 },
"CLS": { "target": 0.1, "alert": 0.25 }
},
"notifications": {
"email": "devteam@example.com",
"slack": "https://hooks.slack.com/..."
}
}
Funnel Analysis
Track multi-step conversion funnels to optimize user flows.
Create a Funnel
Define a sequence of events that represent a user journey:
Define Funnel
// Create funnel via dashboard
{
"name": "Signup Funnel",
"steps": [
{
"name": "Landing Page View",
"event": "pageview",
"filters": { "path": "/" }
},
{
"name": "Signup Page View",
"event": "pageview",
"filters": { "path": "/signup" }
},
{
"name": "Form Submitted",
"event": "signup_form_submit"
},
{
"name": "Email Verified",
"event": "email_verified"
},
{
"name": "Onboarding Completed",
"event": "onboarding_complete"
}
],
"timeWindow": "24h" // Max time between steps
}
Funnel Metrics
- Name
Conversion Rate- Description
Percentage of users who complete all steps
- Name
Drop-off Rate- Description
Percentage of users who exit at each step
- Name
Time to Convert- Description
Average time between first and last step
- Name
Step Conversion- Description
Conversion rate between consecutive steps
- Name
Cohort Analysis- Description
Compare funnels across different user segments
Funnel Visualization
The dashboard provides:
- Visual funnel chart with drop-off indicators
- Step-by-step conversion rates
- Time-to-convert distribution
- User segmentation (device, location, traffic source)
- Historical trends
AI Agent Tracking
Temps automatically detects and classifies AI crawler traffic from agents like ChatGPT, Claude, Perplexity, Googlebot, and 50+ others — no configuration required.
Tracked signals
- Agent name and provider (OpenAI, Anthropic, Google, etc.)
- Pages crawled and request counts
- Unique source IPs per agent
- Request share by agent or provider
Use cases
- Know which AI assistants index your content
- See which pages get crawled most
- Verify llms.txt and sitemap coverage
- Measure LLM training crawl volume
Via CLI
# Which AI agents are hitting your site?
bunx @temps-sdk/cli analytics ai-agents -p my-app --period 7d
# Grouped by AI provider (OpenAI, Anthropic, Google…)
bunx @temps-sdk/cli analytics ai-agents -p my-app --group-by provider
# Which pages do AI crawlers visit most?
bunx @temps-sdk/cli analytics ai-pages -p my-app --period 30d
# Show which agents crawl each page
bunx @temps-sdk/cli analytics ai-pages -p my-app --with-agents
Via REST API
# AI agent breakdown
curl https://your-temps.example.com/api/projects/{project_id}/analytics/ai-agents \
-H "Authorization: Bearer <token>" \
-G --data-urlencode "start_time=2025-01-01T00:00:00Z" \
--data-urlencode "end_time=2025-01-08T00:00:00Z"
# Pages crawled by AI
curl https://your-temps.example.com/api/projects/{project_id}/analytics/ai-pages \
-H "Authorization: Bearer <token>"
View all dimension data
The overview dashboard shows the top 5 or 10 rows for each chart. To see the full dataset, click the View all button in any chart header.
Dimension pages
Each chart's "View all" button opens a dedicated dimension page at /projects/:slug/analytics/dimensions/:dimension. These pages:
- Show up to 100 rows for the selected dimension and date range
- Include an inline text filter for client-side narrowing — useful when a dimension has many distinct values
- Preserve the currently selected date filter, so navigating to a dimension page and back does not reset your time range
The following dimensions have dedicated pages:
| Dimension | What it shows |
|---|---|
pages | Top pages by view count |
referrers | Traffic sources and referring domains |
browsers | Browser distribution |
operating_systems | OS distribution |
devices | Device type (desktop, mobile, tablet) |
countries | Geographic distribution by country |
channels | Acquisition channels (organic, direct, paid, etc.) |
events | Custom event names and occurrence counts |
languages | Browser/OS language preference |
utm_source | UTM source parameter values |
utm_medium | UTM medium parameter values |
utm_campaign | UTM campaign parameter values |
utm_term | UTM term parameter values |
utm_content | UTM content parameter values |
Event detail
Rows in the events dimension link through to the event detail view. The event detail page now shows:
- A first → last timestamp range for that event across all visitors in the selected period
- Per-visitor columns: visitor UUID, numeric visitor ID, device, browser, location, and referrer
Visitor segments
Clicking any row in a non-page dimension chart — for example "Chrome" in Browsers, "United States" in Countries, an event name, a UTM campaign value, or a referrer — opens a visitor segment page.
Segment pages
Segment pages are located at /projects/:slug/analytics/segments/:dimension/:value and show a paginated list of visitors who match that dimension value within the selected date range:
- 25 visitors per page, sorted by last action descending
- Each row links to the individual visitor detail page, where you can see the visitor's full session history, device information, and event timeline
- The active date filter is carried through the entire navigation chain: overview → dimension page → segment → visitor detail → back
Supported segment filters
The segment visitor list is powered by the /analytics/visitors endpoint, which accepts the following filter parameters:
- Name
filter_country- Description
Filter visitors by country code (e.g.
US,DE)
- Name
filter_region- Description
Filter visitors by region or state
- Name
filter_city- Description
Filter visitors by city name
- Name
filter_channel- Description
Filter visitors by acquisition channel (e.g.
organic,direct,paid)
- Name
filter_referrer- Description
Filter visitors by referring domain or URL
- Name
filter_event- Description
Filter visitors who fired a specific event name
- Name
filter_browser- Description
Filter visitors by browser name (e.g.
Chrome,Firefox)
- Name
filter_os- Description
Filter visitors by operating system (e.g.
macOS,Windows)
- Name
filter_device- Description
Filter visitors by device type (
desktop,mobile,tablet)
- Name
filter_language- Description
Filter visitors by browser language preference
- Name
filter_utm_source- Description
Filter visitors by UTM source value
- Name
filter_utm_medium- Description
Filter visitors by UTM medium value
- Name
filter_utm_campaign- Description
Filter visitors by UTM campaign value
- Name
filter_utm_term- Description
Filter visitors by UTM term value
- Name
filter_utm_content- Description
Filter visitors by UTM content value
Date filters are preserved across the full navigation chain — overview, dimension pages, segment pages, and visitor detail — so the cohort you are inspecting stays consistent as you drill down and navigate back.
SDKs
Track events from your frontend and enrich visitor records from your backend using the official SDKs.
React Analytics SDK — provider, hooks, declarative tracking
Node SDK — visitor enrichment, API client reference
Privacy & Compliance
Temps analytics is designed with privacy in mind and complies with GDPR, CCPA, and other regulations.
Data Ownership
- Name
Self-Hosted- Description
All data stays on your infrastructure—no data sent to third parties
- Name
No Cookies- Description
IP-based tracking (no tracking cookies required)
- Name
Anonymization- Description
IP address hashing and anonymization options
- Name
Data Retention- Description
Configurable retention policies (30/90/180/365 days, or custom)
- Name
Right to Erasure- Description
User data deletion via API or dashboard
- Name
Data Export- Description
Export user data in JSON/CSV format
GDPR Compliance
GDPR Configuration
import { TempsAnalyticsProvider } from '@temps-sdk/react-analytics';
function App() {
const [consent, setConsent] = useState(false);
return (
<TempsAnalyticsProvider
disabled={!consent} // Only track if user consents
>
<CookieBanner onAccept={() => setConsent(true)} />
<YourApp />
</TempsAnalyticsProvider>
);
}
Compliance Features
GDPR
- User consent management
- Right to access data
- Right to erasure
- Data portability
- Privacy by design
CCPA
- Do Not Sell disclosure
- Opt-out mechanisms
- Data access requests
- Data deletion requests