You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Direct card views are not tracked, causing incomplete profile analytics #495
thanks for flagging this — I dug into the code and can confirm the exact root cause:
apps/backend/src/services/publicService.ts has three functions serving card/profile data, and only two of them record analytics:
getPublicProfile() (GET /api/u/:username) — creates a cardView record
getUserCard() (GET /api/u/:username/card/:cardId) — creates a cardView record
getCardById() (GET /api/u/card/:cardId — the direct shared-card link, called by apps/web/src/pages/CardPage.tsx) — only fetches and returns the card, no cardView.create() call at all
So this isn't a general "profile vs card" gap — it's specifically this one function missing the tracking + self-view-blocking logic that the other two already have.
Would love to take this on if it's still unassigned — happy to add the fix + a test in apps/backend/src/__tests__/public.test.ts covering both the tracked and self-view-blocked cases, following the existing pattern. Can I get assigned?
Activity
Ridanshi commentedon Jun 6, 2026
I investigated this issue and would like to work on it.
The current analytics implementation appears to track profile views without consistently recording direct card visits.
I plan to:
Please assign this issue to me.
yachikadev commentedon Jun 20, 2026
thanks for flagging this — I dug into the code and can confirm the exact root cause:
apps/backend/src/services/publicService.tshas three functions serving card/profile data, and only two of them record analytics:getPublicProfile()(GET /api/u/:username) — creates acardViewrecordgetUserCard()(GET /api/u/:username/card/:cardId) — creates acardViewrecordgetCardById()(GET /api/u/card/:cardId— the direct shared-card link, called byapps/web/src/pages/CardPage.tsx) — only fetches and returns the card, nocardView.create()call at allSo this isn't a general "profile vs card" gap — it's specifically this one function missing the tracking + self-view-blocking logic that the other two already have.
Would love to take this on if it's still unassigned — happy to add the fix + a test in
apps/backend/src/__tests__/public.test.tscovering both the tracked and self-view-blocked cases, following the existing pattern. Can I get assigned?fix(analytics): track CardView events on direct card route