chore(analytics): register surface: 'app' super-property#107
Merged
Conversation
Tags every PostHog event from the mobile app with surface: 'app' so the app's data stays distinguishable from being-website's data in the shared PostHog project (free-tier constraint: 1 project per account). The website does the mirror in MP2EZ/being-website#42 with ph.register({ surface: 'web' }). After both ship, every PostHog dashboard/insight can filter cleanly on where surface = 'app' (or 'web'), and cross-surface funnels (e.g., "saw website /home → installed app → completed onboarding") are distinguishable from same-surface flows. Implementation: small RegisterSurfaceProperty child component rendered inside <PHProvider> that uses usePostHog() + useEffect to call posthog.register({ surface: 'app' }) on mount. ~15 LOC total. No behavior change beyond the new property — events that fire now will have an additional `surface: 'app'` property, nothing else. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tags every PostHog event from the mobile app with `surface: 'app'` so the app's data stays distinguishable from being-website's data in the shared PostHog project. The website mirrors this in mp2ez/being-website#42 with `ph.register({ surface: 'web' })`.
Why we share the project
Free tier = 1 project per account. Sharing is the deliberate choice pre-launch because:
The website's full PostHog setup + the §5.2 scoping update (#106) handle the disclosure side. This PR is just the symmetric tagging on the app side.
What changes
Filters like `where surface = 'app'` (or `'web'`) work cleanly across the shared project. Cohorts, funnels, retention insights can all be scoped per surface.
Implementation
Small `RegisterSurfaceProperty` child component inside the existing ``. Uses `usePostHog()` hook to get the initialized instance, registers the super-property in a `useEffect`. ~15 LOC total.
No behavior change beyond the new property:
Test plan
Related
🤖 Generated with Claude Code