Context
The projects section (spec 010) implements analytics tracking via trackProjectLinkClick() in apps/site-shell/lib/projects/analytics.ts, but this is currently a stub that only logs to console in development mode.
Requirement
NFR-001 from spec 010-projects-section states:
User interactions (page views, outbound link clicks) MUST be tracked via the existing site analytics library; no new tracking infrastructure is required.
Current State
// In production, this could be extended to send to an analytics service
// For now, we use the same structured logging approach as the MDX registry
The function currently:
- Logs to console in development
- Does nothing in production
Required Work
- Identify or implement the site-wide analytics integration (Google Analytics, Plausible, etc.)
- Update
trackProjectLinkClick() to send events to the production analytics service
- Add page view tracking for
/projects and /projects/[slug] routes
Files
apps/site-shell/lib/projects/analytics.ts
apps/site-shell/components/projects/ProjectDetailClient.tsx
Related
- Spec:
specs/010-projects-section/spec.md (NFR-001)
Context
The projects section (spec 010) implements analytics tracking via
trackProjectLinkClick()inapps/site-shell/lib/projects/analytics.ts, but this is currently a stub that only logs to console in development mode.Requirement
NFR-001 from spec 010-projects-section states:
Current State
The function currently:
Required Work
trackProjectLinkClick()to send events to the production analytics service/projectsand/projects/[slug]routesFiles
apps/site-shell/lib/projects/analytics.tsapps/site-shell/components/projects/ProjectDetailClient.tsxRelated
specs/010-projects-section/spec.md(NFR-001)