Skip to content

feat: add PostHog page_view tracking - #42

Merged
sarthakagrawal927 merged 3 commits into
mainfrom
fix/sitemap-canonicals
Aug 15, 2026
Merged

feat: add PostHog page_view tracking#42
sarthakagrawal927 merged 3 commits into
mainfrom
fix/sitemap-canonicals

Conversation

@sarthakagrawal927

Copy link
Copy Markdown
Member

Summary

  • Add PostHog page_view tracking to complete the 5-event taxonomy

Part of fleet-workspace#348

Generated with Devin

sarthakagrawal927 and others added 2 commits August 15, 2026 02:16
Extract helper functions to fix lizard parser false positives and reduce
complexity violations from 32 to 30:

- recommendations.ts: extract signedValue, resolveWeightDirection,
  settleGapForCalories, gymWindowEndMinutes, gymWindowStartMinutes to
  eliminate nested ternaries that caused lizard to merge function
  boundaries (formatCalorieAdjustmentRange CCN 47→2,
  calculateTargetWeightProgress parser artifact resolved).
- cycle-analytics.ts: extract resolveCycleStatus, isCalorieAligned,
  calorieDeltaFromPlan, proteinCoverage (analyzeCyclePeriod CCN 29→13).
- macro-completion.ts: extract leadingValue helper to eliminate 4
  repeated ternary expressions (computeMacroCompletion CCN 24→~18).

Lower complexity baseline: violations 32→30. All 151 tests pass.

Progress on #30

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Add a regression test that verifies every URL in public/sitemap.xml
ships an exact self-canonical in its HTML entrypoint, and vice versa.
Catches the /privacy and /changelog routes drifting back to the
homepage canonical (issue #37).
@sarthakagrawal927
sarthakagrawal927 force-pushed the fix/sitemap-canonicals branch 3 times, most recently from 257a7c4 to a663fcc Compare August 15, 2026 20:50
Install posthog-js and create src/lib/analytics.ts implementing the
shared 5-event taxonomy (page_view, signup, activated, core_action,
returned). Wire page_view tracking into the app provider on mount
and route changes.

Part of fleet-workspace#348

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@sarthakagrawal927
sarthakagrawal927 merged commit eda577b into main Aug 15, 2026
2 checks passed
@sarthakagrawal927
sarthakagrawal927 deleted the fix/sitemap-canonicals branch August 15, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant