← Back to Portfolio

Site Analytics Dashboard

Real-time visitor analytics for this portfolio site — tracked in PostgreSQL, visualised with Chart.js. This is the exact type of dashboard built at GrowthPulse to replace 12+ hours/week of manual reporting.

Page Views (Last 7 Days)
Unique Sessions (Last 7 Days)
All-Time Page Views
Daily Page Views — Last 7 Days
Top Pages
🏗️ How This Works

A custom Django middleware (PageTrackingMiddleware) intercepts every GET request, stores the page path, timestamp, and session key in PostgreSQL. This page queries a /api/analytics/ JSON endpoint that aggregates the data with Django ORM annotations (TruncDate, Count). Chart.js renders it client-side. Refreshes every 60 seconds automatically.