Skip to content

Commit a12317c

Browse files
committed
feat(onboarding): add tracking for Vercel GitHub steps
Add telemetry events to the Vercel onboarding modal to better track user interactions with the GitHub integration flow. Specifically: - Fire an event when the GitHub step is shown, including whether the GitHub app is already installed (github_app_installed). - Track when the user clicks the "Install GitHub app" button. - Track when the user completes the GitHub onboarding step. - Track when the user skips the GitHub onboarding step (applies to multiple skip paths). Also add gitHubAppInstallations.length to the effect dependency array to ensure the "step viewed" event updates correctly when installation state changes. These events improve analytics for onboarding funnels and help identify drop-off or friction points in the GitHub integration flow.
1 parent 38981f5 commit a12317c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

apps/webapp/app/components/integrations/VercelOnboardingModal.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,15 @@ export function VercelOnboardingModal({
543543

544544
if (!isGitHubConnectedForOnboarding) {
545545
setState("github-connection");
546+
capture("vercel onboarding github step viewed", {
547+
origin: fromMarketplaceContext ? "marketplace" : "dashboard",
548+
step: "github-connection",
549+
organization_slug: organizationSlug,
550+
project_slug: projectSlug,
551+
github_app_installed: gitHubAppInstallations.length > 0,
552+
});
546553
}
547-
}, [vercelStagingEnvironment, pullEnvVarsBeforeBuild, atomicBuilds, discoverEnvVars, syncEnvVarsMapping, nextUrl, fromMarketplaceContext, isGitHubConnectedForOnboarding, completeOnboardingFetcher, actionUrl, trackOnboarding]);
554+
}, [vercelStagingEnvironment, pullEnvVarsBeforeBuild, atomicBuilds, discoverEnvVars, syncEnvVarsMapping, nextUrl, fromMarketplaceContext, isGitHubConnectedForOnboarding, completeOnboardingFetcher, actionUrl, trackOnboarding, capture, organizationSlug, projectSlug, gitHubAppInstallations.length]);
548555

549556
const handleFinishOnboarding = useCallback((e: React.FormEvent<HTMLFormElement>) => {
550557
e.preventDefault();
@@ -1081,6 +1088,7 @@ export function VercelOnboardingModal({
10811088
)}
10821089
variant="secondary/medium"
10831090
LeadingIcon={OctoKitty}
1091+
onClick={() => trackOnboarding("vercel onboarding github app install clicked")}
10841092
>
10851093
Install GitHub app
10861094
</LinkButton>
@@ -1110,6 +1118,7 @@ export function VercelOnboardingModal({
11101118
<Button
11111119
variant="primary/medium"
11121120
onClick={() => {
1121+
trackOnboarding("vercel onboarding github completed");
11131122
setState("completed");
11141123
const validUrl = safeRedirectUrl(nextUrl);
11151124
if (validUrl) {
@@ -1123,6 +1132,7 @@ export function VercelOnboardingModal({
11231132
<Button
11241133
variant="tertiary/medium"
11251134
onClick={() => {
1135+
trackOnboarding("vercel onboarding github skipped");
11261136
setState("completed");
11271137
if (fromMarketplaceContext && nextUrl) {
11281138
const validUrl = safeRedirectUrl(nextUrl);
@@ -1141,6 +1151,7 @@ export function VercelOnboardingModal({
11411151
<Button
11421152
variant="tertiary/medium"
11431153
onClick={() => {
1154+
trackOnboarding("vercel onboarding github skipped");
11441155
setState("completed");
11451156
}}
11461157
>

0 commit comments

Comments
 (0)