Skip to content

Track ide changed event during onboarding #16568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions components/dashboard/src/onboarding/UserOnboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { StepPersonalize } from "./StepPersonalize";
import { useUpdateCurrentUserMutation } from "../data/current-user/update-mutation";
import Alert from "../components/Alert";
import { useConfetti } from "../contexts/ConfettiContext";
import { getGitpodService } from "../service/service";

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

try {
// 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"
// We can do this once we rely on the profile.onboardedTimestamp instead.
const onboardedUser = await updateUser.mutateAsync(updates);

// TODO: move this into a mutation side effect once we have a specific mutation for updating the IDE (see above TODO)
getGitpodService().server.trackEvent({
event: "ide_configuration_changed",
properties: {
...(onboardedUser.additionalData?.ideSettings ?? {}),
location: "onboarding",
},
});

dropConfetti();
setUser(onboardedUser);

Expand Down