diff --git a/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/project-states/page.tsx b/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/project-states/page.tsx
index 42cf79cf33..d624c3d624 100644
--- a/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/project-states/page.tsx
+++ b/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/project-states/page.tsx
@@ -4,6 +4,7 @@ import React from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// plane imports
+import { PROJECT_GROUPING_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { EUserWorkspaceRoles } from "@plane/types";
import { ToggleSwitch } from "@plane/ui";
@@ -12,6 +13,7 @@ import { NotAuthorizedView } from "@/components/auth-screens";
import { PageHead } from "@/components/core";
// store hooks
import { SettingsContentWrapper, SettingsHeading } from "@/components/settings";
+import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useUserPermissions, useWorkspace } from "@/hooks/store";
// plane web components
import { WithFeatureFlagHOC } from "@/plane-web/components/feature-flags";
@@ -44,13 +46,24 @@ const WorklogsPage = observer(() => {
if (!isAdmin) return ;
const toggleProjectGroupingFeature = async () => {
+ const willEnableProjectGrouping = !isProjectGroupingEnabled;
try {
const payload = {
- [EWorkspaceFeatures.IS_PROJECT_GROUPING_ENABLED]: !isProjectGroupingEnabled,
+ [EWorkspaceFeatures.IS_PROJECT_GROUPING_ENABLED]: willEnableProjectGrouping,
};
await updateWorkspaceFeature(workspaceSlug.toString(), payload);
+ captureSuccess({
+ eventName: willEnableProjectGrouping
+ ? PROJECT_GROUPING_TRACKER_EVENTS.ENABLE
+ : PROJECT_GROUPING_TRACKER_EVENTS.DISABLE,
+ });
} catch (error) {
console.error(error);
+ captureError({
+ eventName: willEnableProjectGrouping
+ ? PROJECT_GROUPING_TRACKER_EVENTS.DISABLE
+ : PROJECT_GROUPING_TRACKER_EVENTS.ENABLE,
+ });
}
};
diff --git a/apps/web/ee/components/license/modal/trial-button.tsx b/apps/web/ee/components/license/modal/trial-button.tsx
index 1a71c2f3c2..6b61d45a19 100644
--- a/apps/web/ee/components/license/modal/trial-button.tsx
+++ b/apps/web/ee/components/license/modal/trial-button.tsx
@@ -4,19 +4,23 @@ import { useState } from "react";
import { useParams } from "next/navigation";
// plane imports
import { Loader } from "lucide-react";
+import { LICENSE_TRACKER_ELEMENTS, LICENSE_TRACKER_EVENTS } from "@plane/constants";
+import { EProductSubscriptionEnum } from "@plane/types";
import { setToast, TOAST_TYPE } from "@plane/ui";
import { cn } from "@plane/utils";
// plane web imports
+import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useWorkspaceSubscription } from "@/plane-web/hooks/store";
export type TTrialButtonProps = {
- productId: string | undefined;
- priceId: string | undefined;
handleClose: () => void;
+ priceId: string | undefined;
+ productId: string | undefined;
+ variant: EProductSubscriptionEnum;
};
export const TrialButton: React.FC = (props: TTrialButtonProps) => {
- const { productId, priceId, handleClose } = props;
+ const { handleClose, productId, priceId, variant } = props;
// router
const { workspaceSlug } = useParams();
// states
@@ -39,6 +43,12 @@ export const TrialButton: React.FC = (props: TTrialButtonProp
await freeTrialSubscription(workspaceSlug.toString(), { product_id: productId, price_id: priceId });
handleClose();
handleSuccessModalToggle(true);
+ captureSuccess({
+ eventName: LICENSE_TRACKER_EVENTS.trial_started,
+ payload: {
+ plan: variant,
+ },
+ });
} catch (error) {
const currentError = error as unknown as { error: string; detail: string };
console.error("Error in freeTrialSubscription", error);
@@ -47,6 +57,12 @@ export const TrialButton: React.FC = (props: TTrialButtonProp
title: "Error!",
message: currentError?.detail ?? currentError?.error ?? "Something went wrong. Please try again.",
});
+ captureError({
+ eventName: LICENSE_TRACKER_EVENTS.trial_started,
+ payload: {
+ plan: variant,
+ },
+ });
} finally {
setTrialLoader(false);
}
@@ -54,6 +70,7 @@ export const TrialButton: React.FC = (props: TTrialButtonProp
return (