Skip to content

fix: use $pageview event for PostHog web analytics#164

Merged
Hugo0 merged 1 commit into
mainfrom
fix/enable-posthog-pageview
Mar 15, 2026
Merged

fix: use $pageview event for PostHog web analytics#164
Hugo0 merged 1 commit into
mainfrom
fix/enable-posthog-pageview

Conversation

@Hugo0

@Hugo0 Hugo0 commented Mar 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • Renames page_view_enhanced$pageview so PostHog's built-in web analytics (DAU, WAU, bounce rate) works
  • Keeps capture_pageview: false — we send $pageview manually to attach custom properties (language, platform, referrer, is_pwa)
  • No change in event volume

Test plan

  • Verify PostHog Web Analytics dashboard shows DAU/WAU after deploy
  • Verify GA4 still receives pageview events

Summary by CodeRabbit

  • Chores
    • Updated internal event tracking identifiers and cleaned up analytics configuration code.

…lytics

PostHog's built-in DAU/WAU/bounce rate dashboards require the $pageview
event name. We were sending page_view_enhanced which PostHog didn't
recognize for web analytics. Keep capture_pageview: false and send
$pageview manually with our custom properties (language, platform, etc).
@coderabbitai

coderabbitai Bot commented Mar 15, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9d68a2f4-038f-4e6b-a639-bb8c7bb36a93

📥 Commits

Reviewing files that changed from the base of the PR and between 82dc9b8 and 5c8473f.

📒 Files selected for processing (2)
  • frontend/src/analytics.ts
  • frontend/src/posthog.ts

📝 Walkthrough

Walkthrough

Updates GA4 core event identifier from page_view_enhanced to $pageview across analytics tracking and documentation. Also removes an inline comment from PostHog configuration without altering functionality.

Changes

Cohort / File(s) Summary
GA4 Event Identifier Updates
frontend/src/analytics.ts
Replaced GA4 core event name from page_view_enhanced to $pageview in the GA4_EVENTS set, updated Safe dual-send wrapper documentation, and modified session-context page-view emission via trackPageView.
PostHog Configuration
frontend/src/posthog.ts
Removed inline comment on the capture_pageview setting; no behavioral changes to initialization logic.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Poem

🐰 A hop through the logs, so bright and so keen,
From enhanced views to the core-events scene,
$pageview now shines with clarity pure,
Analytics dance—our tracking's secure!

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/enable-posthog-pageview
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Hugo0
Hugo0 merged commit f1c7b52 into main Mar 15, 2026
4 checks passed
@Hugo0
Hugo0 deleted the fix/enable-posthog-pageview branch April 15, 2026 17:55
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