diff --git a/app/Http/Controllers/App/OnboardingController.php b/app/Http/Controllers/App/OnboardingController.php index 1acb2c7e..80475a77 100644 --- a/app/Http/Controllers/App/OnboardingController.php +++ b/app/Http/Controllers/App/OnboardingController.php @@ -106,7 +106,9 @@ public function storeGoals(StoreOnboardingGoalsRequest $request, PostHogService $user->update(['goals' => $goals]); - $postHog->identify($user->id, $this->goalProperties($goals)); + $postHog->identify($user->id, [ + 'goals' => $goals, + ]); return redirect()->route('app.onboarding.connect'); } @@ -183,22 +185,4 @@ public function checkout(Request $request, StartSubscriptionCheckout $checkout): route('app.onboarding.connect'), ); } - - /** - * PostHog person properties for the selected goals: the full array plus a - * boolean per goal, so campaigns can be cross-tabbed against each intent. - * - * @param array $goals - * @return array - */ - private function goalProperties(array $goals): array - { - $properties = ['onboarding_goals' => $goals]; - - foreach (Goal::cases() as $goal) { - $properties["goal_{$goal->value}"] = in_array($goal->value, $goals, true); - } - - return $properties; - } }