Repository navigation
feat(analytics): identify users universally + instrument onboarding funnel - #30
Merged
Merged
Conversation
…unnel
PostHog was creating events under random anonymous distinct_ids for
anyone who didn't pass through the sign-in form (page reloads, OAuth
returns, email-confirm landings, etc.), so clicking an ID in PostHog
showed "No profile associated with this ID" and the funnel below the
sign-up step was opaque.
This commit fixes the two layers behind that gap:
1. AuthProvider now subscribes to Supabase's onAuthStateChange and
calls identify() on INITIAL_SESSION / SIGNED_IN, reset() on
SIGNED_OUT. The form-level identify() in sign-in-form is removed
as redundant — auth state is the single source of truth.
2. Onboarding page fires a structured step funnel:
- onboarding_step_viewed on every step render (1..6)
- onboarding_step_completed on every transition, carrying
step-specific props (brand_domain, region, topic_count,
prompt_count, competitor_count, plan_id)
- setPersonProperties at meaningful points so the person record
accrues company_url, region, language, onboarding_completed,
intended_plan as the user advances
Existing onboarding_brand_created / onboarding_prompts_saved events
stay in place for backward compatibility with anything already wired
up to them.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Merged
This branch was successfully deployed
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
Layer 1 — universal identify
`AuthProvider` now subscribes to Supabase's `onAuthStateChange` and calls:
The form-level `identify()` in `sign-in-form` is removed as redundant — auth state is now the single source of truth, so every signed-in user gets a person profile regardless of how they landed.
Layer 2 — onboarding funnel + person enrichment
The onboarding page now fires a structured step funnel:
Existing `onboarding_brand_created` / `onboarding_prompts_saved` events are kept for backward compatibility with anything already wired up to them.
Privacy
Test plan