chore: add onboarding events in posthog (#25981)

* add onboarding events in posthog

* Update apps/web/modules/onboarding/organization/teams/organization-teams-view.tsx

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This commit is contained in:
sean-brydonandcubic-dev-ai[bot] authored and GitHub committed 2025-12-17 22:43:54 +00:00
1 parent e84550ba76
commit 64767cec4f
7 files changed
+77 -9

No files matched your search

@@ -2,6 +2,7 @@
import { AnimatePresence } from "framer-motion";
import { useRouter } from "next/navigation";
import posthog from "posthog-js";
import { useEffect, useRef, useTransition } from "react";
import { useTeamInvites } from "@calcom/features/billing/hooks/useHasPaidPlan";
@@ -69,6 +70,11 @@ export const OnboardingView = ({ userEmail }: OnboardingViewProps) => {
}, [selectedPlan]);
const handleContinue = () => {
if (selectedPlan) {
posthog.capture("onboarding_plan_continue_clicked", {
plan_type: selectedPlan,
});
}
startTransition(() => {
if (selectedPlan === "organization") {
router.push("/onboarding/organization/details");
@@ -157,7 +163,13 @@ export const OnboardingView = ({ userEmail }: OnboardingViewProps) => {
{/* Plan options */}
<RadioAreaGroup.Group
value={selectedPlan ?? undefined}
onValueChange={(value) => setSelectedPlan(value as PlanType)}
onValueChange={(value) => {
const planType = value as PlanType;
setSelectedPlan(planType);
posthog.capture("onboarding_plan_selected", {
plan_type: planType,
});
}}
className="flex w-full flex-col gap-1 rounded-[10px]">
{plans.map((plan) => {
const isSelected = selectedPlan === plan.id;