Skip to content

chore(analytics): register surface: 'app' super-property#107

Merged
MP2EZ merged 2 commits into
developmentfrom
chore/app-posthog-surface-superproperty
May 30, 2026
Merged

chore(analytics): register surface: 'app' super-property#107
MP2EZ merged 2 commits into
developmentfrom
chore/app-posthog-surface-superproperty

Conversation

@MP2EZ
Copy link
Copy Markdown
Owner

@MP2EZ MP2EZ commented May 30, 2026

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:

  • Cross-surface funnels ("saw website /home → installed app → completed onboarding") are visible in one place
  • Free tier 1M events/month is plenty for both surfaces at current/expected volumes
  • EU residency + vendor disclosure are already in privacy policy §5.1 + §5.2; project topology is an implementation detail, not a user-facing data flow change

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

Before After
Events from app: untagged (no `surface` property) Events from app: `surface: 'app'` on every event

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:

  • Events that fire now will have an additional `surface: 'app'` property; nothing else changes
  • All existing privacy/consent gating preserved (opt-in default, universal-opt-out kill switch)
  • No new vendor, no new data flow, no new consent surface

Test plan

  • TypeScript compiles (added `usePostHog` to the import, used standard PostHog `register()` API)
  • Manual: launch app with analytics opt-in enabled → verify events in PostHog dashboard now have `surface: 'app'` property
  • Manual: confirm no regression in existing analytics behavior (opt-in default, universal-opt-out still suppresses)

Related

🤖 Generated with Claude Code

MP2EZ and others added 2 commits May 30, 2026 12:50
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>
@MP2EZ MP2EZ merged commit 9dbcf20 into development May 30, 2026
22 checks passed
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