Add public PageView tracking for portal analytics #4

Merged
westfarn merged 1 commits from feat/3-public-pageview-analytics into main 2026-08-20 03:34:57 -07:00
Owner

Summary

Closes #3.

  • Add PageView model + migration for successful public marketing GET hits
  • Wire PublicPageViewMiddleware (skips portal/admin/accounts/api/static/health/etc.; fails soft on DB errors)
  • Portal analytics report: last-30-day views + top pages table
  • Admin registration and tests

Test plan

  • Apply migration analytics.0002_pageview
  • Hit / and /about/ → rows in PageView / admin
  • Hit /healthz/, /portal/, /admin/ → no new pageviews
  • Open portal Analytics → views count + Top pages look right
  • uv run python site/manage.py test analytics.tests
## Summary Closes #3. - Add `PageView` model + migration for successful public marketing GET hits - Wire `PublicPageViewMiddleware` (skips portal/admin/accounts/api/static/health/etc.; fails soft on DB errors) - Portal analytics report: last-30-day views + top pages table - Admin registration and tests ## Test plan - [ ] Apply migration `analytics.0002_pageview` - [ ] Hit `/` and `/about/` → rows in `PageView` / admin - [ ] Hit `/healthz/`, `/portal/`, `/admin/` → no new pageviews - [ ] Open portal Analytics → views count + Top pages look right - [ ] `uv run python site/manage.py test analytics.tests`
westfarn added 1 commit 2026-08-20 03:32:23 -07:00
Add public PageView tracking for portal analytics.
CI / test (pull_request) Successful in 13s
b054097f3d
Closes #3 — record successful public GET hits, show last-30-day views and top pages on the analytics report, and keep portal/admin/API paths out of the counts.
westfarn merged commit 46abaa6917 into main 2026-08-20 03:34:57 -07:00
westfarn deleted branch feat/3-public-pageview-analytics 2026-08-20 03:34:57 -07:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ai_ml_operations/monica_site#4