Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
f65c1f4
feat: event tracker helper
Jun 30, 2025
edc3c81
feat: track click events for `data-ph-element`
Jun 30, 2025
bb56fc3
fix: handled click events
gakshita Jun 30, 2025
f19befd
fix: handled name
gakshita Jun 30, 2025
f366f95
chore: tracker element updates
Jun 30, 2025
5301f63
chore: remove export
Jun 30, 2025
8011b76
chore: tracker element type
Jun 30, 2025
ff0112f
chore: track element and event helper.
Jun 30, 2025
5c30d0d
chore: minor improvements
Jun 30, 2025
ef93781
chore: minor refactors
Jun 30, 2025
4b510b8
fix: workspace events
gakshita Jun 30, 2025
9f8872e
fix: added slug
gakshita Jun 30, 2025
0d58c18
fix: changes nomenclature
gakshita Jun 30, 2025
06dc802
Merge branch 'refactor-event-trackers' of https://github.com/makeplan…
gakshita Jun 30, 2025
7ec3673
Merge pull request #7287 from makeplane/fix-workspace-events
gakshita Jun 30, 2025
bc39053
fix: nomenclature
gakshita Jun 30, 2025
f5cc076
chore: update event tracker helper types
Jun 30, 2025
3545008
fix: data id
gakshita Jun 30, 2025
db1caa7
refactor: cycle events (#7290)
prateekshourya29 Jul 1, 2025
be77cf8
Merge branch 'refactor-event-trackers' of github.com:makeplane/plane …
prateekshourya29 Jul 1, 2025
90991df
Refactor module events (#7291)
prateekshourya29 Jul 1, 2025
785f857
Merge branch 'refactor-event-trackers' of github.com:makeplane/plane …
prateekshourya29 Jul 1, 2025
9cd75e6
Merge branch 'preview' of github.com:makeplane/plane into refactor-ev…
prateekshourya29 Jul 1, 2025
59140aa
refactor: global views, product tour, notifications, onboarding, user…
prateekshourya29 Jul 1, 2025
477d5f7
Merge pull request #7303 from makeplane/refactor-addition-events
gakshita Jul 1, 2025
47f3dd4
chore: member tracker events (#7302)
gakshita Jul 1, 2025
37fd368
refactor: update event tracker constants
prateekshourya29 Jul 1, 2025
72d9318
refactor: auth related event trackers (#7306)
prateekshourya29 Jul 1, 2025
d4d49f5
Chore: state events (#7307)
gakshita Jul 1, 2025
b17ee72
chore: project events (#7305)
gakshita Jul 1, 2025
c6f9d35
fix: removed hardcoded values
gakshita Jul 1, 2025
af42ebe
fix: github redirection event
gakshita Jul 1, 2025
20b75a2
chore: project page tracker events (#7304)
gakshita Jul 1, 2025
3051751
chore: minor cleanup and import fixes
prateekshourya29 Jul 1, 2025
349b98f
refactor: added tracker elements for buttons (#7308)
vamsikrishnamathala Jul 1, 2025
b7541b6
fix: event type
Palanikannan1437 Jul 1, 2025
da58043
refactor: posthog group event
prateekshourya29 Jul 1, 2025
5bc5b18
chore: removed instances of event tracker (#7309)
vamsikrishnamathala Jul 1, 2025
9ae2887
refactor: remove event tracker stores and hooks
prateekshourya29 Jul 1, 2025
874e11b
refactor: remove event tracker store
prateekshourya29 Jul 1, 2025
e39dc36
Merge branch 'preview' of github.com:makeplane/plane into refactor-ev…
prateekshourya29 Jul 1, 2025
b07cba1
fix: build errors
prateekshourya29 Jul 1, 2025
aac6867
clean up event tracker payloads
prateekshourya29 Jul 1, 2025
c320e3c
chore: profile settings events
gakshita Jul 2, 2025
e72becd
Merge branch 'preview' of https://github.com/makeplane/plane into cho…
gakshita Jul 2, 2025
444c5d6
fix: refactor
gakshita Jul 2, 2025
c8b0893
Merge branch 'preview' of https://github.com/makeplane/plane into cho…
gakshita Jul 8, 2025
4bf9ecc
chore: fix merge conflicts and add comments
sriramveeraghanta Jul 10, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { useState } from "react";
import { observer } from "mobx-react";
import useSWR from "swr";
// plane imports
import { PROFILE_SETTINGS_TRACKER_ELEMENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
// component
import { APITokenService } from "@plane/services";
Expand All @@ -14,6 +15,7 @@ import { SettingsHeading } from "@/components/settings";
import { APITokenSettingsLoader } from "@/components/ui";
import { API_TOKENS_LIST } from "@/constants/fetch-keys";
// store hooks
import { captureClick } from "@/helpers/event-tracker.helper";
import { useWorkspace } from "@/hooks/store";
import { useResolvedAssetPath } from "@/hooks/use-resolved-asset-path";
// services
Expand Down Expand Up @@ -53,7 +55,12 @@ const ApiTokensPage = observer(() => {
description={t("account_settings.api_tokens.description")}
button={{
label: t("workspace_settings.settings.api_tokens.add_token"),
onClick: () => setIsCreateTokenModalOpen(true),
onClick: () => {
captureClick({
elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.HEADER_ADD_PAT_BUTTON,
});
setIsCreateTokenModalOpen(true);
},
}}
/>
<div>
Expand All @@ -69,7 +76,12 @@ const ApiTokensPage = observer(() => {
description={t("account_settings.api_tokens.description")}
button={{
label: t("workspace_settings.settings.api_tokens.add_token"),
onClick: () => setIsCreateTokenModalOpen(true),
onClick: () => {
captureClick({
elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.HEADER_ADD_PAT_BUTTON,
});
setIsCreateTokenModalOpen(true);
},
}}
/>
<div className="h-full w-full flex items-center justify-center">
Expand All @@ -81,7 +93,12 @@ const ApiTokensPage = observer(() => {
size="md"
primaryButton={{
text: t("workspace_settings.settings.api_tokens.add_token"),
onClick: () => setIsCreateTokenModalOpen(true),
onClick: () => {
captureClick({
elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.EMPTY_STATE_ADD_PAT_BUTTON,
});
setIsCreateTokenModalOpen(true);
},
}}
/>
</div>
Expand Down
14 changes: 11 additions & 3 deletions apps/web/core/components/account/deactivate-account-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import React, { useState } from "react";
import { Trash2 } from "lucide-react";
import { Dialog, Transition } from "@headlessui/react";
import { PROFILE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
// ui
import { Button, TOAST_TYPE, setToast } from "@plane/ui";
// hooks
import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useUser } from "@/hooks/store";
import { useAppRouter } from "@/hooks/use-app-router";

Expand Down Expand Up @@ -35,6 +37,9 @@ export const DeactivateAccountModal: React.FC<Props> = (props) => {

await deactivateAccount()
.then(() => {
captureSuccess({
eventName: PROFILE_SETTINGS_TRACKER_EVENTS.deactivate_account,
});
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
Expand All @@ -44,13 +49,16 @@ export const DeactivateAccountModal: React.FC<Props> = (props) => {
router.push("/");
handleClose();
})
.catch((err: any) =>
.catch((err: any) => {
captureError({
eventName: PROFILE_SETTINGS_TRACKER_EVENTS.deactivate_account,
});
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
message: err?.error,
})
)
});
})
.finally(() => setIsDeactivating(false));
};

Expand Down
17 changes: 17 additions & 0 deletions apps/web/core/components/api-token/delete-token-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
import { useState, FC } from "react";
import { mutate } from "swr";
// types
import { PROFILE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { APITokenService } from "@plane/services";
import { IApiToken } from "@plane/types";
// ui
import { AlertModalCore, TOAST_TYPE, setToast } from "@plane/ui";
// fetch-keys
import { API_TOKENS_LIST } from "@/constants/fetch-keys";
import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";

type Props = {
isOpen: boolean;
Expand Down Expand Up @@ -48,6 +50,12 @@ export const DeleteApiTokenModal: FC<Props> = (props) => {
(prevData) => (prevData ?? []).filter((token) => token.id !== tokenId),
false
);
captureSuccess({
eventName: PROFILE_SETTINGS_TRACKER_EVENTS.pat_deleted,
payload: {
token: tokenId,
},
});

handleClose();
})
Expand All @@ -58,6 +66,15 @@ export const DeleteApiTokenModal: FC<Props> = (props) => {
message: err?.message ?? t("workspace_settings.settings.api_tokens.delete.error.message"),
})
)
.catch((err) => {
captureError({
eventName: PROFILE_SETTINGS_TRACKER_EVENTS.pat_deleted,
payload: {
token: tokenId,
},
error: err as Error,
});
})
.finally(() => setDeleteLoading(false));
};

Expand Down
12 changes: 12 additions & 0 deletions apps/web/core/components/api-token/modal/create-token-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import React, { useState } from "react";
import { mutate } from "swr";
// types
import { PROFILE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { APITokenService } from "@plane/services";
import { IApiToken } from "@plane/types";
// ui
Expand All @@ -12,6 +13,7 @@ import { renderFormattedDate, csvDownload } from "@plane/utils";
import { CreateApiTokenForm, GeneratedTokenDetails } from "@/components/api-token";
// fetch-keys
import { API_TOKENS_LIST } from "@/constants/fetch-keys";
import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// helpers
// services

Expand Down Expand Up @@ -66,6 +68,12 @@ export const CreateApiTokenModal: React.FC<Props> = (props) => {
},
false
);
captureSuccess({
eventName: PROFILE_SETTINGS_TRACKER_EVENTS.pat_created,
payload: {
token: res.id,
},
});
})
.catch((err) => {
setToast({
Expand All @@ -74,6 +82,10 @@ export const CreateApiTokenModal: React.FC<Props> = (props) => {
message: err.message || err.detail,
});

captureError({
eventName: PROFILE_SETTINGS_TRACKER_EVENTS.pat_created,
});

throw err;
});
};
Expand Down
2 changes: 2 additions & 0 deletions apps/web/core/components/api-token/token-list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { useState } from "react";
import { XCircle } from "lucide-react";
import { PROFILE_SETTINGS_TRACKER_ELEMENTS } from "@plane/constants";
import { IApiToken } from "@plane/types";
// components
import { Tooltip } from "@plane/ui";
Expand Down Expand Up @@ -31,6 +32,7 @@ export const ApiTokenListItem: React.FC<Props> = (props) => {
<button
onClick={() => setDeleteModalOpen(true)}
className="absolute right-4 hidden place-items-center group-hover:grid"
data-ph-element={PROFILE_SETTINGS_TRACKER_ELEMENTS.LIST_ITEM_DELETE_ICON}
>
<XCircle className="h-4 w-4 text-red-500" />
</button>
Expand Down
31 changes: 31 additions & 0 deletions apps/web/core/components/core/theme/custom-theme-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import { useMemo } from "react";
import { observer } from "mobx-react";
import { Controller, useForm } from "react-hook-form";
// types
import { PROFILE_SETTINGS_TRACKER_ELEMENTS, PROFILE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { IUserTheme } from "@plane/types";
// ui
import { Button, InputColorPicker, setPromiseToast } from "@plane/ui";
// hooks
import { captureElementAndEvent } from "@/helpers/event-tracker.helper";
import { useUserProfile } from "@/hooks/store";

type TCustomThemeSelector = {
Expand Down Expand Up @@ -81,6 +83,35 @@ export const CustomThemeSelector: React.FC<TCustomThemeSelector> = observer((pro
message: () => t("failed_to_update_the_theme"),
},
});
updateCurrentUserThemePromise
.then(() => {
captureElementAndEvent({
element: {
elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.THEME_DROPDOWN,
},
event: {
eventName: PROFILE_SETTINGS_TRACKER_EVENTS.theme_updated,
payload: {
theme: payload.theme,
},
state: "SUCCESS",
},
});
})
.catch(() => {
captureElementAndEvent({
element: {
elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.THEME_DROPDOWN,
},
event: {
eventName: PROFILE_SETTINGS_TRACKER_EVENTS.theme_updated,
payload: {
theme: payload.theme,
},
state: "ERROR",
},
});
});

return;
};
Expand Down
26 changes: 24 additions & 2 deletions apps/web/core/components/profile/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Controller, useForm } from "react-hook-form";
import { ChevronDown, CircleUserRound, InfoIcon } from "lucide-react";
import { Disclosure, Transition } from "@headlessui/react";
// plane imports
import { PROFILE_SETTINGS_TRACKER_ELEMENTS, PROFILE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import type { IUser, TUserProfile } from "@plane/types";
import { Button, Input, TOAST_TYPE, setPromiseToast, setToast } from "@plane/ui";
Expand All @@ -16,6 +17,7 @@ import { DeactivateAccountModal } from "@/components/account";
import { ImagePickerPopover, UserImageUploadModal } from "@/components/core";
// helpers
// hooks
import { captureSuccess, captureError } from "@/helpers/event-tracker.helper";
import { useUser, useUserProfile } from "@/hooks/store";

type TUserProfileForm = {
Expand Down Expand Up @@ -135,6 +137,17 @@ export const ProfileForm = observer((props: TProfileFormProps) => {
message: () => `There was some error in updating your profile. Please try again.`,
},
});
updateUserAndProfile
.then(() => {
captureSuccess({
eventName: PROFILE_SETTINGS_TRACKER_EVENTS.update_profile,
});
})
.catch(() => {
captureError({
eventName: PROFILE_SETTINGS_TRACKER_EVENTS.update_profile,
});
});
};

return (
Expand Down Expand Up @@ -344,7 +357,12 @@ export const ProfileForm = observer((props: TProfileFormProps) => {
</div>
<div className="flex flex-col gap-1">
<div className="flex items-center justify-between pt-6 pb-8">
<Button variant="primary" type="submit" loading={isLoading}>
<Button
variant="primary"
type="submit"
loading={isLoading}
data-ph-element={PROFILE_SETTINGS_TRACKER_ELEMENTS.SAVE_CHANGES_BUTTON}
>
{isLoading ? t("saving") : t("save_changes")}
</Button>
</div>
Expand All @@ -371,7 +389,11 @@ export const ProfileForm = observer((props: TProfileFormProps) => {
<div className="flex flex-col gap-8">
<span className="text-sm tracking-tight">{t("deactivate_account_description")}</span>
<div>
<Button variant="danger" onClick={() => setDeactivateAccountModal(true)}>
<Button
variant="danger"
onClick={() => setDeactivateAccountModal(true)}
data-ph-element={PROFILE_SETTINGS_TRACKER_ELEMENTS.DEACTIVATE_ACCOUNT_BUTTON}
>
{t("deactivate_account")}
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

import React, { FC, useEffect } from "react";
import { Controller, useForm } from "react-hook-form";
import { PROFILE_SETTINGS_TRACKER_ELEMENTS, PROFILE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { IUserEmailNotificationSettings } from "@plane/types";
// ui
import { ToggleSwitch, TOAST_TYPE, setToast } from "@plane/ui";
// services
import { captureClick, captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { UserService } from "@/services/user.service";
// types
interface IEmailNotificationFormProps {
Expand All @@ -31,13 +33,25 @@ export const EmailNotificationForm: FC<IEmailNotificationFormProps> = (props) =>
await userService.updateCurrentUserEmailNotificationSettings({
[key]: value,
});
captureSuccess({
eventName: PROFILE_SETTINGS_TRACKER_EVENTS.notifications_updated,
payload: {
[key]: value,
},
});
setToast({
title: t("success"),
type: TOAST_TYPE.SUCCESS,
message: t("email_notification_setting_updated_successfully"),
});
} catch (err) {
console.error(err);
captureError({
eventName: PROFILE_SETTINGS_TRACKER_EVENTS.notifications_updated,
payload: {
[key]: value,
},
});
setToast({
title: t("error"),
type: TOAST_TYPE.ERROR,
Expand Down Expand Up @@ -68,6 +82,9 @@ export const EmailNotificationForm: FC<IEmailNotificationFormProps> = (props) =>
value={value}
onChange={(newValue) => {
onChange(newValue);
captureClick({
elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.PROPERTY_CHANGES_TOGGLE,
});
handleSettingChange("property_change", newValue);
}}
size="sm"
Expand All @@ -90,6 +107,9 @@ export const EmailNotificationForm: FC<IEmailNotificationFormProps> = (props) =>
value={value}
onChange={(newValue) => {
onChange(newValue);
captureClick({
elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.STATE_CHANGES_TOGGLE,
});
handleSettingChange("state_change", newValue);
}}
size="sm"
Expand Down Expand Up @@ -134,6 +154,9 @@ export const EmailNotificationForm: FC<IEmailNotificationFormProps> = (props) =>
value={value}
onChange={(newValue) => {
onChange(newValue);
captureClick({
elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.COMMENTS_TOGGLE,
});
handleSettingChange("comment", newValue);
}}
size="sm"
Expand All @@ -156,6 +179,9 @@ export const EmailNotificationForm: FC<IEmailNotificationFormProps> = (props) =>
value={value}
onChange={(newValue) => {
onChange(newValue);
captureClick({
elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.MENTIONS_TOGGLE,
});
handleSettingChange("mention", newValue);
}}
size="sm"
Expand Down
Loading
Loading