Analytics
First-party visitor tracking, UTM attribution, revenue analytics and consent management.
VibeKit includes an integrated analytics system that runs directly on top of your PostgreSQL database. Instead of paying for outside tracking services or slowing down your site with third-party JavaScript, you get native visibility into traffic, acquisition channels, and revenue conversion.
How First-Party Tracking Works
The analytics engine lives in packages/analytics. Whenever someone browses your product or marketing site, pageviews and custom interactions are recorded directly into your database.
- Cookieless Option: Anonymizes visitor IP addresses using a daily rotating SHA-256 hash. You can track unique visitors and bounce rates without storing cookies on their device.
- Zero Third-Party Dependencies: No network calls to external advertising networks or foreign analytics servers.
- Automatic Route Fencing: Tracking is automatically disabled on sensitive pages, including login (
/auth), password resets, checkout (/checkout), and account settings (/app/settings).
Marketing & UTM Attribution
VibeKit automatically analyzes inbound query parameters and HTTP referrer headers to tell you where your traffic came from:
- Campaign Tags: Captures
utm_source,utm_medium,utm_campaign,utm_content, andutm_term. - Channel Grouping: Traffic without UTM tags is automatically classified into Search (Google, Bing), Social (X, LinkedIn, Reddit, YouTube), Direct, or Referral.
- First-Touch Attribution: Preserves the original channel that brought a visitor to your site so you can trace future signups back to their starting point.
Connecting Traffic to Revenue
Unlike simple pageview counters, VibeKit links payment transactions from Stripe, Lemon Squeezy, and Paddle back to visitor sessions.
When an anonymous visitor later converts into a paying customer:
- The payment record is tied to their initial acquisition channel.
- You can see which marketing campaigns drove paying subscribers versus casual readers.
- Key metrics like Average Order Value and Customer Lifetime Value are calculated automatically.
The Admin Dashboard (/app/admin/analytics)
Platform administrators have access to an interactive analytics console:
- Live Activity: Real-time counter of current visitors and the specific URLs they are viewing.
- Timeseries Charts: Track visitors, pageviews, and bounce rates over 7-day, 30-day, or 90-day windows.
- Page Breakdown: Filter top content between public marketing pages and authenticated app workspaces.
- Conversion Funnels: Build step-by-step paths (like
/pricing$\rightarrow$checkout_start$\rightarrow$purchase) to see where potential customers drop out. - Visitor Timeline: Click on any visitor entry to see the chronological path of pages they visited before taking an action.
Third-Party Provider Adapters
If your team already uses an established analytics tool, VibeKit provides pre-built adapters in apps/web/analytics/provider:
| Provider | Setup Variable | Purpose |
|---|---|---|
| None (Default) | None | Runs purely on your PostgreSQL database |
| Plausible | NEXT_PUBLIC_PLAUSIBLE_DOMAIN | Lightweight, cookie-free EU analytics |
| PostHog | NEXT_PUBLIC_POSTHOG_KEY | Event tracking, session replays, and feature flags |
| Google Analytics 4 | NEXT_PUBLIC_GA_MEASUREMENT_ID | Search ads tracking and campaign integration |
| Pirsch | NEXT_PUBLIC_PIRSCH_CODE | Privacy-first cookieless analytics |
| Amplitude | NEXT_PUBLIC_AMPLITUDE_API_KEY | Product telemetry and retention cohorts |
When an external provider is enabled, the built-in ConsentBanner automatically blocks external scripts until the visitor opts in.
Coding Agent Instructions
To customize tracking or connect an outside provider, give your coding agent this prompt:
Help me configure analytics for my product:
1. Review the existing analytics setup in packages/analytics and config.ts.
2. Track custom events for key product milestones in my app.
3. Make sure sensitive paths (/auth, /checkout, /settings) remain excluded.
4. Verify tracking with $verify-changes.