feat(onboarding): add "where you found us" referral-source step - #188
Merged
Conversation
Adds a single-select referral-source step between the goals and connect steps of onboarding. The choice is stored on users.referral_source and mirrored to PostHog, mirroring the existing persona and goals steps. - ReferralSource enum (12 sources) + nullable users.referral_source column - referralSource()/storeReferralSource() controller actions with the same self-hosted, subscribed, persona and goals guards as the sibling steps - connect() now requires a referral source before rendering - Single-select ReferralSource.vue page mirroring the goals step - Localized across all 15 locales
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.
What
Adds a "Where did you find us?" step to onboarding, between the goals and connect steps:
/onboarding(persona) →/onboarding/goals→/onboarding/referral-source(new) →/onboarding/connectUsers pick a single source (Google, X, LinkedIn, YouTube, TikTok, Instagram, Reddit, Product Hunt, AI assistant, Friend, Blog, Other). The choice is stored on
users.referral_sourceand mirrored to PostHog — exactly the waypersonaandgoalsalready work.Why
Attribution: understand which channels bring new signups, using the same lightweight onboarding pattern we already have.
Changes
Backend
App\Enums\User\ReferralSource— 12 string-backed casesreferral_sourcecolumn onusers+$fillable/cast onUserStoreOnboardingReferralSourceRequest—required+Rule::enumOnboardingController::referralSource()/storeReferralSource()— same guard ladder as the sibling steps (self-hosted → calendar, subscribed → calendar, no persona → onboarding, no goals → goals), saves +PostHog::identify(['referral_source' => …])connect()now requires a referral source before rendering;storeGoals()now advances to the new stepapp.onboarding.referral-source[.store]Frontend
resources/js/pages/onboarding/ReferralSource.vue— single-select page mirroringGoals.vue, Tabler brand icons per sourcei18n
referral_source_title,referral_source_description, and 12 source labels across all 15 localesSelf-hosted
Never sees the screen — the first guard is
self_hosted → calendar, same as every other onboarding step.Tests
OnboardingControllerTest: render, all guards, self-hosted, subscribed, validation (required + invalid enum), store + PostHog + redirect, and the newconnect()guard. Existing connect / full-flow / self-hosted tests updated for the new required field.LocalizationParityTestgreen.pint+eslintclean.Notes
php artisan wayfinder:generate/ the vite plugin.checkout()is intentionally left without areferral_sourceguard, matching howpersona/goalsare handled today (gated at theconnect()GET, not at the checkout POST).