Server-side analytics component for Convex apps that tracks product events from mutations and actions, immune to ad blockers and page unload drops.
npm install convalytics-devConvalytics provides server-side analytics for Convex applications, allowing you to track product events reliably from mutations and actions. Unlike client-side tracking, server-side events bypass ad blockers and aren't lost on page unloads. It includes web analytics capabilities and provides a unified dashboard for both server events and browser page views.
The Convalytics Component lets you track events directly from Convex mutations using analytics.track(ctx, {name: 'user_signed_up', userId, props}). Events are delivered asynchronously and never throw errors, ensuring your mutation logic remains unaffected.
Track subscription renewals, feature usage, and user actions from Convex actions and mutations. Server-side tracking ensures events are captured even when users have ad blockers or close tabs before client-side scripts complete.
Track events from third-party webhooks in Convex httpActions, like Stripe payment events. The component handles event delivery asynchronously so webhook responses remain fast and reliable.
Combine server-side product event tracking with browser page view analytics. Add the Convalytics script to your frontend and use the component for backend events to get complete user journey visibility.
No, the Convalytics Component delivers events asynchronously and never throws errors. Analytics failures are logged but never propagate to your mutations or actions, ensuring your core application logic remains unaffected.
Yes, the Convalytics Component works in both mutations and actions. Use analytics.track(ctx, event) in mutations for database operations and in httpActions for webhook processing or external API calls.
Set your write key as a Convex environment variable using npx convex env set CONVALYTICS_WRITE_KEY your_key. Get your write key from the Convalytics dashboard or use npx convalytics init to auto-generate one.
The Convalytics Component accepts event name, userId, optional userEmail, userName, sessionId, timestamp, and custom properties. Properties support strings, numbers, and booleans for flexible event metadata.
The Convalytics Component handles server-side tracking only. For complete analytics, pair it with the Convalytics browser script for page views and client-side events in the same dashboard.