Skip to content

Commit 29869f7

Browse files
track ide changed event during onboarding (#16568)
1 parent afd38dc commit 29869f7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

components/dashboard/src/onboarding/UserOnboarding.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { StepPersonalize } from "./StepPersonalize";
1616
import { useUpdateCurrentUserMutation } from "../data/current-user/update-mutation";
1717
import Alert from "../components/Alert";
1818
import { useConfetti } from "../contexts/ConfettiContext";
19+
import { getGitpodService } from "../service/service";
1920

2021
// This param is optionally present to force an onboarding flow
2122
// Can be used if other conditions aren't true, i.e. if user has already onboarded, but we want to force the flow again
@@ -74,7 +75,19 @@ const UserOnboarding: FunctionComponent<Props> = ({ user }) => {
7475
};
7576

7677
try {
78+
// TODO: extract the IDE updating into it's own step, and add a mutation for it once we don't rely on it to consider a user being "onboarded"
79+
// We can do this once we rely on the profile.onboardedTimestamp instead.
7780
const onboardedUser = await updateUser.mutateAsync(updates);
81+
82+
// TODO: move this into a mutation side effect once we have a specific mutation for updating the IDE (see above TODO)
83+
getGitpodService().server.trackEvent({
84+
event: "ide_configuration_changed",
85+
properties: {
86+
...(onboardedUser.additionalData?.ideSettings ?? {}),
87+
location: "onboarding",
88+
},
89+
});
90+
7891
dropConfetti();
7992
setUser(onboardedUser);
8093

0 commit comments

Comments
 (0)