About this project

Privacy-Friendly Analytics is a self-hosted product telemetry reference implementation for ASP.NET Core applications. It allows developers to collect usage data directly into their own SQL Server database instead of relying on third-party analytics platforms, keeping business inputs and user-entered domain data private. Built with .NET 10, ASP.NET Core, EF Core, SQL Server, and TypeScript, the project provides a minimal dashboard showing total events, page sessions, workflow start/completion rates, and positive feedback rates. The architecture follows a clean separation: the browser sends allow-listed events to an ASP.NET Core endpoint, which persists them via EF Core into SQL Server. The ingestion endpoint enforces strict data-minimization rules—unknown event names return 400 errors, unknown properties are discarded, nested objects and arbitrary payloads are rejected by the sanitizer, string properties have size limits, and no IP address is explicitly persisted. No account or persistent browser identifier is required. Session IDs exist only for the lifetime of the page. The TypeScript client sends telemetry asynchronously with a short timeout and never blocks the application workflow when analytics is unavailable. The demo includes rate limiting at 60 requests per minute per application instance. Pre-compiled events include: demo_opened, workflow_started, workflow_completed, feature_used, and feedback_submitted. The project is not intended as legal advice; production deployments should assess applicable privacy and ePrivacy regulations for their jurisdiction and use case. The dashboard is public-only for ease of running the demo and should be protected with authentication before production use.