From 756078672d2fe2a6ccbb8cc5a039131062866d5d Mon Sep 17 00:00:00 2001 From: Talisson Costa Date: Thu, 26 Nov 2026 11:24:53 -0300 Subject: [PATCH 1/2] chore(Tracking): Remove the unused page-view tracking trackPage only fed Universal Analytics. usePageTracking becomes useSaveLastEnvironment, keeping the lastEnv storage it also did. Co-Authored-By: Claude Opus 5.5 --- frontend/common/constants.ts | 28 ------- frontend/common/hooks/usePageTracking.ts | 84 ------------------- .../common/hooks/useSaveLastEnvironment.ts | 22 +++++ frontend/global.d.ts | 1 - .../web/components/modals/payment/Payment.tsx | 5 -- .../web/components/pages/CheckEmailPage.tsx | 6 -- .../pages/CreateEnvironmentPage.tsx | 3 - .../pages/CreateOrganisationPage.tsx | 2 - .../components/pages/EmailActivationPage.tsx | 6 -- .../web/components/pages/IdentityPage.tsx | 1 - .../web/components/pages/IntegrationsPage.tsx | 7 +- frontend/web/components/pages/InvitePage.js | 5 -- .../components/pages/NotFoundErrorPage.tsx | 7 +- .../pages/OrganisationIntegrationsPage.tsx | 7 +- .../web/components/pages/PasswordResetPage.js | 5 -- .../web/components/pages/SegmentsPage.tsx | 4 - .../EnvironmentSettingsPage.tsx | 1 - .../FeatureLifecyclePage.tsx | 10 --- .../pages/features/FeaturesPage.tsx | 15 ++-- .../components/pages/home-page/HomePage.tsx | 4 +- .../OrganisationSettingsPage.tsx | 5 -- .../project-settings/ProjectSettingsPage.tsx | 7 +- frontend/web/project/api.ts | 4 - 23 files changed, 32 insertions(+), 207 deletions(-) delete mode 100644 frontend/common/hooks/usePageTracking.ts create mode 100644 frontend/common/hooks/useSaveLastEnvironment.ts diff --git a/frontend/common/constants.ts b/frontend/common/constants.ts index f5cef1160c54..701195d44873 100644 --- a/frontend/common/constants.ts +++ b/frontend/common/constants.ts @@ -636,37 +636,9 @@ const Constants = { ], isCustomFlagsmithUrl: () => Constants.getFlagsmithSDKUrl() !== 'https://edge.api.flagsmith.com/api/v1/', - modals: { - 'PAYMENT': 'Payment Modal', - }, organisationPermissions: (perm: OrganisationPermission) => { return `To manage this feature you need the ${OrganisationPermissionDescriptions[perm]} permission for this organisation.
Please contact a member of this organisation who has administrator privileges.` }, - pages: { - 'ACCOUNT': 'Account Page', - 'AUDIT_LOG': 'Audit Log Page', - 'CHECK_EMAIL': 'Check Email Page', - 'COMING_SOON': 'Coming Soon Page', - 'CREATE_ENVIRONMENT': 'Create Environment Page', - 'CREATE_ORGANISATION': 'Create Organisation Page', - 'DOCUMENTATION': 'Documentation Page', - 'EMAIL_ACTIVATION': 'Email Activation Page', - 'ENVIRONMENT_SETTINGS': 'Environment Settings Page', - 'FEATURES': 'Features Page', - 'HOME': 'Home Page', - 'INTEGRATIONS': 'Integrations Page', - 'INVITE': 'User Invited Page', - 'NOT_FOUND': '404 Page', - 'ORGANISATION_SETTINGS': 'Organisation Settings Page', - 'POLICIES': 'Terms & Policies Page', - 'PRICING': 'Pricing Page', - 'PROJECT_SELECT': 'Project Select Page', - 'PROJECT_SETTINGS': 'Project Settings Page', - 'RESET_PASSWORD': 'Reset Password Page', - 'USER': 'User Page', - 'USERS': 'Users Page', - 'WHAT_ARE_FEATURE_FLAGS': 'What are feature flags Page', - }, projectPermissions: (perm: ProjectPermission) => { return `To use this feature you need the ${ProjectPermissionDescriptions[perm]} permission for this project.
Please contact a member of this project who has administrator privileges.` }, diff --git a/frontend/common/hooks/usePageTracking.ts b/frontend/common/hooks/usePageTracking.ts deleted file mode 100644 index 13a87e6bd295..000000000000 --- a/frontend/common/hooks/usePageTracking.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { useEffect } from 'react' - -/** - * Options for configuring page tracking behavior. - */ -type PageTrackingOptions = { - /** The page constant name from Constants.pages */ - pageName: string - /** Context data for tracking and storage persistence */ - context?: { - environmentId?: string - projectId?: number - organisationId?: number - } - /** Whether to save context to AsyncStorage (default: false) */ - saveToStorage?: boolean - /** Custom dependencies for re-tracking on changes */ - deps?: React.DependencyList -} - -/** - * Unified hook for tracking page views with optional context persistence. - * - * Consolidates both page tracking and environment context storage into a single, - * flexible hook. Automatically calls API.trackPage and optionally persists - * environment context to AsyncStorage. - * - * @param options - Configuration object for page tracking - * - * @example - * ```tsx - * // Basic page tracking only - * usePageTracking({ pageName: Constants.pages.FEATURES }) - * - * // With context and storage persistence - * usePageTracking({ - * pageName: Constants.pages.FEATURES, - * context: { environmentId, projectId, organisationId }, - * saveToStorage: true, - * }) - * - * // With custom dependencies - * usePageTracking({ - * pageName: Constants.pages.FEATURES, - * context: { projectId }, - * deps: [projectId, someOtherDep], - * }) - * ``` - */ -export function usePageTracking(options: PageTrackingOptions): void { - const { context, deps = [], pageName, saveToStorage = false } = options - - // Track page view - useEffect(() => { - if (typeof API !== 'undefined' && API.trackPage) { - API.trackPage(pageName) - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, deps) - - // Persist environment context to storage if enabled - useEffect(() => { - if (saveToStorage && context) { - if (typeof AsyncStorage !== 'undefined' && AsyncStorage.setItem) { - AsyncStorage.setItem( - 'lastEnv', - JSON.stringify({ - environmentId: context.environmentId, - orgId: context.organisationId, - projectId: context.projectId, - }), - ) - } - } - // We intentionally use individual properties instead of context object - // to prevent re-runs when object reference changes but values don't - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [ - saveToStorage, - context?.environmentId, - context?.organisationId, - context?.projectId, - ]) -} diff --git a/frontend/common/hooks/useSaveLastEnvironment.ts b/frontend/common/hooks/useSaveLastEnvironment.ts new file mode 100644 index 000000000000..ebcdfd9fd19e --- /dev/null +++ b/frontend/common/hooks/useSaveLastEnvironment.ts @@ -0,0 +1,22 @@ +import { useEffect } from 'react' + +type LastEnvironment = { + environmentId?: string + organisationId?: number + projectId?: number +} + +export function useSaveLastEnvironment({ + environmentId, + organisationId, + projectId, +}: LastEnvironment): void { + useEffect(() => { + if (typeof AsyncStorage !== 'undefined' && AsyncStorage.setItem) { + AsyncStorage.setItem( + 'lastEnv', + JSON.stringify({ environmentId, orgId: organisationId, projectId }), + ) + } + }, [environmentId, organisationId, projectId]) +} diff --git a/frontend/global.d.ts b/frontend/global.d.ts index e410ca900bef..667b037baa07 100644 --- a/frontend/global.d.ts +++ b/frontend/global.d.ts @@ -46,7 +46,6 @@ declare global { const toast: (message: string) => void const Tooltip: FC const API: { - trackPage: (title: string, path?: string) => void trackEvent: (data: { category: string event: string diff --git a/frontend/web/components/modals/payment/Payment.tsx b/frontend/web/components/modals/payment/Payment.tsx index 4ab4971aa092..66882e2d08f4 100644 --- a/frontend/web/components/modals/payment/Payment.tsx +++ b/frontend/web/components/modals/payment/Payment.tsx @@ -1,5 +1,4 @@ import React, { FC, useEffect } from 'react' -import Constants from 'common/constants' import InfoMessage from 'components/InfoMessage' import BlockedOrgInfo from 'components/BlockedOrgInfo' import { Organisation } from 'common/types/responses' @@ -36,10 +35,6 @@ export const Payment: FC = ({ const { hasActiveSubscription, isAWS, plan, setYearly, yearly } = usePaymentState({ organisation }) - useEffect(() => { - API.trackPage(Constants.modals.PAYMENT) - }, []) - useEffect(() => { if (ready && !error) { bindChargebeeButtons({ isPaymentsEnabled }) diff --git a/frontend/web/components/pages/CheckEmailPage.tsx b/frontend/web/components/pages/CheckEmailPage.tsx index 739aae19733f..a52c41cb801e 100644 --- a/frontend/web/components/pages/CheckEmailPage.tsx +++ b/frontend/web/components/pages/CheckEmailPage.tsx @@ -4,11 +4,9 @@ import { Link, useHistory, useLocation } from 'react-router-dom' import AccountStore from 'common/stores/account-store' import Button from 'components/base/forms/Button' import Card from 'components/Card' -import Constants from 'common/constants' import ErrorMessage from 'components/ErrorMessage' import InfoMessage from 'components/InfoMessage' import NavIconSmall from 'components/icons/NavIconSmall' -import API from 'project/api' import { useResendActivationEmailMutation } from 'common/services/useEmailActivation' type LocationState = { email?: string } | undefined @@ -27,10 +25,6 @@ const CheckEmailPage: FC = () => { const [resendActivationEmail, { isError, isLoading, isSuccess }] = useResendActivationEmailMutation() - useEffect(() => { - API.trackPage(Constants.pages.CHECK_EMAIL) - }, []) - useEffect(() => { if (!email) { history.replace('/login') diff --git a/frontend/web/components/pages/CreateEnvironmentPage.tsx b/frontend/web/components/pages/CreateEnvironmentPage.tsx index 89d16561cc44..d8abdda28187 100644 --- a/frontend/web/components/pages/CreateEnvironmentPage.tsx +++ b/frontend/web/components/pages/CreateEnvironmentPage.tsx @@ -15,7 +15,6 @@ import ProjectProvider, { import AccountStore from 'common/stores/account-store' import Utils from 'common/utils/utils' import { useHistory } from 'react-router-dom' -import API from 'project/api' import FieldLabel from 'components/base/forms/FieldLabel' import InputGroup from 'components/base/forms/InputGroup' import { Environment, Role, User } from 'common/types/responses' @@ -136,8 +135,6 @@ const CreateEnvironmentPage: React.FC = () => { } useEffect(() => { - API.trackPage(Constants.pages.CREATE_ENVIRONMENT) - if (Utils.getPlansPermission('METADATA')) { getSupportedContentType(getStore(), { organisation_id: AccountStore.getOrganisation().id, diff --git a/frontend/web/components/pages/CreateOrganisationPage.tsx b/frontend/web/components/pages/CreateOrganisationPage.tsx index 617a41e2c013..1e825b133014 100644 --- a/frontend/web/components/pages/CreateOrganisationPage.tsx +++ b/frontend/web/components/pages/CreateOrganisationPage.tsx @@ -3,7 +3,6 @@ import FieldLabel from 'components/base/forms/FieldLabel' import Link from 'components/base/link/Link' import { useHistory } from 'react-router-dom' import ConfigProvider from 'common/providers/ConfigProvider' -import Constants from 'common/constants' import PageTitle from 'components/PageTitle' import CondensedRow from 'components/CondensedRow' import InputGroup from 'components/base/forms/InputGroup' @@ -79,7 +78,6 @@ const CreateOrganisationPage: React.FC = () => { }, [hosting, history, showHostingPreferences, updateTools]) useEffect(() => { - API.trackPage(Constants.pages.CREATE_ORGANISATION) focusTimeout.current = setTimeout(() => { inputRef.current?.focus?.() focusTimeout.current = null diff --git a/frontend/web/components/pages/EmailActivationPage.tsx b/frontend/web/components/pages/EmailActivationPage.tsx index ddc51b71952e..e53f15e7edbf 100644 --- a/frontend/web/components/pages/EmailActivationPage.tsx +++ b/frontend/web/components/pages/EmailActivationPage.tsx @@ -12,13 +12,11 @@ import { FetchBaseQueryError } from '@reduxjs/toolkit/query' import AccountStore from 'common/stores/account-store' import Button from 'components/base/forms/Button' import Card from 'components/Card' -import Constants from 'common/constants' import ErrorMessage from 'components/ErrorMessage' import InfoMessage from 'components/InfoMessage' import InputGroup from 'components/base/forms/InputGroup' import NavIconSmall from 'components/icons/NavIconSmall' import Utils from 'common/utils/utils' -import API from 'project/api' import { useActivateAccountMutation, useResendActivationEmailMutation, @@ -60,10 +58,6 @@ const EmailActivationPage: FC = () => { const status = (activationError as FetchBaseQueryError | undefined)?.status const isLinkSpent = status === 400 || status === 403 - useEffect(() => { - API.trackPage(Constants.pages.EMAIL_ACTIVATION, '/activate') - }, []) - const activate = useCallback(() => { activateAccount({ token, uid }) .unwrap() diff --git a/frontend/web/components/pages/IdentityPage.tsx b/frontend/web/components/pages/IdentityPage.tsx index e4dc84b8eee4..ae641e8e556e 100644 --- a/frontend/web/components/pages/IdentityPage.tsx +++ b/frontend/web/components/pages/IdentityPage.tsx @@ -99,7 +99,6 @@ const IdentityPage: FC = () => { AppActions.getIdentity(environmentId, id) getTags(getStore(), { projectId: `${projectId}` }) getActualFlags() - API.trackPage(Constants.pages.USER) // eslint-disable-next-line }, []) diff --git a/frontend/web/components/pages/IntegrationsPage.tsx b/frontend/web/components/pages/IntegrationsPage.tsx index 143e692fcdb5..1660bc487e20 100644 --- a/frontend/web/components/pages/IntegrationsPage.tsx +++ b/frontend/web/components/pages/IntegrationsPage.tsx @@ -1,10 +1,9 @@ -import React, { FC, useEffect } from 'react' +import React, { FC } from 'react' import IntegrationList from 'components/IntegrationList' import { useHasPermission } from 'common/providers/Permission' import Constants from 'common/constants' import PageTitle from 'components/PageTitle' import Utils from 'common/utils/utils' -import API from 'project/api' import { useGetProjectQuery } from 'common/services/useProject' import { useRouteContext } from 'components/providers/RouteContext' import { @@ -33,10 +32,6 @@ export type IntegrationSummary = { const IntegrationsPage: FC = () => { const { organisationId, projectId } = useRouteContext() - useEffect(() => { - API.trackPage(Constants.pages.INTEGRATIONS) - }, []) - const integrationData = Utils.getIntegrationData() const integrations = Object.keys(integrationData).sort((a, b) => (integrationData[a]?.title || a).localeCompare( diff --git a/frontend/web/components/pages/InvitePage.js b/frontend/web/components/pages/InvitePage.js index cc7706609d0a..306f1c63058c 100644 --- a/frontend/web/components/pages/InvitePage.js +++ b/frontend/web/components/pages/InvitePage.js @@ -1,5 +1,4 @@ import React, { Component } from 'react' -import Constants from 'common/constants' import { withRouter } from 'react-router-dom' import AccountProvider from 'common/providers/AccountProvider' const InvitePage = class extends Component { @@ -11,10 +10,6 @@ const InvitePage = class extends Component { AppActions.acceptInvite(this.props.match.params.id) } - componentDidMount = () => { - API.trackPage(Constants.pages.INVITE) - } - onSave = (id) => { AppActions.selectOrganisation(id) this.props.history.replace(Utils.getOrganisationHomePage(id)) diff --git a/frontend/web/components/pages/NotFoundErrorPage.tsx b/frontend/web/components/pages/NotFoundErrorPage.tsx index 827b2649c9da..9fba9a85219e 100644 --- a/frontend/web/components/pages/NotFoundErrorPage.tsx +++ b/frontend/web/components/pages/NotFoundErrorPage.tsx @@ -1,11 +1,6 @@ -import React, { FC, useEffect } from 'react' -import Constants from 'common/constants' +import React, { FC } from 'react' const NotFoundErrorPage: FC = () => { - useEffect(() => { - API.trackPage(Constants.pages.COMING_SOON) - }, []) - return (

Oops!

diff --git a/frontend/web/components/pages/OrganisationIntegrationsPage.tsx b/frontend/web/components/pages/OrganisationIntegrationsPage.tsx index 2c84655e6106..bc3641a6ea25 100644 --- a/frontend/web/components/pages/OrganisationIntegrationsPage.tsx +++ b/frontend/web/components/pages/OrganisationIntegrationsPage.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react' +import React from 'react' import IntegrationList from 'components/IntegrationList' import Constants from 'common/constants' import PageTitle from 'components/PageTitle' @@ -6,13 +6,8 @@ import Utils from 'common/utils/utils' import AccountStore from 'common/stores/account-store' import { OrganisationPermission } from 'common/types/permissions.types' import { useHasPermission } from 'common/providers/Permission' -import API from 'project/api' const OrganisationIntegrationsPage = ({ match }) => { - useEffect(() => { - API.trackPage(Constants.pages.INTEGRATIONS) - }, []) - const integrationData = Utils.getIntegrationData() const allIntegrations = Object.keys(integrationData).sort((a, b) => (integrationData[a]?.title || a).localeCompare( diff --git a/frontend/web/components/pages/PasswordResetPage.js b/frontend/web/components/pages/PasswordResetPage.js index 09f8e390b7ed..12c63e387ece 100644 --- a/frontend/web/components/pages/PasswordResetPage.js +++ b/frontend/web/components/pages/PasswordResetPage.js @@ -1,5 +1,4 @@ import React, { Component } from 'react' -import Constants from 'common/constants' import ErrorMessage from 'components/ErrorMessage' import { withRouter } from 'react-router-dom' const PasswordResetPage = class extends Component { @@ -10,10 +9,6 @@ const PasswordResetPage = class extends Component { this.state = {} } - componentDidMount = () => { - API.trackPage(Constants.pages.RESET_PASSWORD) - } - onSave = () => { this.props.history.replace('/login') toast('Your password has been reset') diff --git a/frontend/web/components/pages/SegmentsPage.tsx b/frontend/web/components/pages/SegmentsPage.tsx index 2fe170b7b848..a35def6b7441 100644 --- a/frontend/web/components/pages/SegmentsPage.tsx +++ b/frontend/web/components/pages/SegmentsPage.tsx @@ -10,7 +10,6 @@ import { useGetSegmentsQuery, } from 'common/services/useSegment' import { useHasPermission } from 'common/providers/Permission' -import API from 'project/api' import Button from 'components/base/forms/Button' import Chip from 'components/base/Chip' import CreateSegmentModal from 'components/modals/CreateSegment' @@ -75,9 +74,6 @@ const SegmentsPage: FC = () => { ProjectStore.getMaxSegmentsAllowed(), ) - useEffect(() => { - API.trackPage(Constants.pages.FEATURES) - }, []) useEffect(() => { if (error) { // Kick user back out to projects diff --git a/frontend/web/components/pages/environment-settings/EnvironmentSettingsPage.tsx b/frontend/web/components/pages/environment-settings/EnvironmentSettingsPage.tsx index 5cf3353f48ed..7bf34e0cf227 100644 --- a/frontend/web/components/pages/environment-settings/EnvironmentSettingsPage.tsx +++ b/frontend/web/components/pages/environment-settings/EnvironmentSettingsPage.tsx @@ -164,7 +164,6 @@ const EnvironmentSettingsPage: React.FC = () => { }, [match.params.environmentId, getEnvironment]) useEffect(() => { - API.trackPage(Constants.pages.ENVIRONMENT_SETTINGS) getEnvironment() }, [getEnvironment]) diff --git a/frontend/web/components/pages/feature-lifecycle/FeatureLifecyclePage.tsx b/frontend/web/components/pages/feature-lifecycle/FeatureLifecyclePage.tsx index 7801ee5b1ad7..5ce27efff122 100644 --- a/frontend/web/components/pages/feature-lifecycle/FeatureLifecyclePage.tsx +++ b/frontend/web/components/pages/feature-lifecycle/FeatureLifecyclePage.tsx @@ -1,7 +1,6 @@ import React, { FC, useCallback, useMemo, useState } from 'react' import { useParams } from 'react-router-dom' import { useRouteContext } from 'components/providers/RouteContext' -import { usePageTracking } from 'common/hooks/usePageTracking' import { hasActiveFilters } from 'common/utils/featureFilterParams' import PageTitle from 'components/PageTitle' import Icon from 'components/icons/Icon' @@ -97,15 +96,6 @@ const FeatureLifecyclePage: FC = () => { section, }) - usePageTracking({ - context: { - organisationId: routeContext.organisationId, - projectId: projectIdNum, - }, - pageName: 'CLEANUP', - saveToStorage: false, - }) - if (!environmentId) { return (
diff --git a/frontend/web/components/pages/features/FeaturesPage.tsx b/frontend/web/components/pages/features/FeaturesPage.tsx index 918f90b284ec..43afdfd0d680 100644 --- a/frontend/web/components/pages/features/FeaturesPage.tsx +++ b/frontend/web/components/pages/features/FeaturesPage.tsx @@ -2,13 +2,12 @@ import React, { FC, useCallback, useEffect, useMemo } from 'react' import cloneDeep from 'lodash/cloneDeep' import { useHistory } from 'react-router-dom' import CreateFlagModal from 'components/modals/create-feature' -import Constants from 'common/constants' import Utils from 'common/utils/utils' import AppActions from 'common/dispatcher/app-actions' import FeatureListStore from 'common/stores/feature-list-store' import { FEATURES_PAGE_SIZE } from 'common/services/useProjectFlag' import { useRouteContext } from 'components/providers/RouteContext' -import { usePageTracking } from 'common/hooks/usePageTracking' +import { useSaveLastEnvironment } from 'common/hooks/useSaveLastEnvironment' import FeatureRow from 'components/feature-summary/FeatureRow' import FeatureRowSkeleton from 'components/feature-summary/FeatureRowSkeleton' import JSONReference from 'components/JSONReference' @@ -185,14 +184,10 @@ const FeaturesPage: FC = ({ forcedTagIds, pageTitle }) => { projectId, }) - usePageTracking({ - context: { - environmentId, - organisationId: routeContext.organisationId, - projectId, - }, - pageName: Constants.pages.FEATURES, - saveToStorage: true, + useSaveLastEnvironment({ + environmentId, + organisationId: routeContext.organisationId, + projectId, }) const openNewFlagModal = () => { diff --git a/frontend/web/components/pages/home-page/HomePage.tsx b/frontend/web/components/pages/home-page/HomePage.tsx index 22e7b3740d0e..361050e88a9d 100644 --- a/frontend/web/components/pages/home-page/HomePage.tsx +++ b/frontend/web/components/pages/home-page/HomePage.tsx @@ -12,7 +12,7 @@ import ForgotPasswordModal from 'components/modals/ForgotPasswordModal' import Card from 'components/Card' import NavIconSmall from 'components/icons/NavIconSmall' import ConfigProvider from 'common/providers/ConfigProvider' -import Constants, { PASSWORD_CHANGED_SESSION_KEY } from 'common/constants' +import { PASSWORD_CHANGED_SESSION_KEY } from 'common/constants' import ErrorMessage from 'components/ErrorMessage' import Button from 'components/base/forms/Button' import PasswordRequirements from 'components/PasswordRequirements' @@ -191,8 +191,6 @@ const HomePage: React.FC = () => { } } - API.trackPage(Constants.pages.HOME) - if (document.location.href.indexOf('invite') !== -1) { const invite = params.redirect if (invite?.includes('invite-link')) { diff --git a/frontend/web/components/pages/organisation-settings/OrganisationSettingsPage.tsx b/frontend/web/components/pages/organisation-settings/OrganisationSettingsPage.tsx index 2190e3d528c4..1467207facd8 100644 --- a/frontend/web/components/pages/organisation-settings/OrganisationSettingsPage.tsx +++ b/frontend/web/components/pages/organisation-settings/OrganisationSettingsPage.tsx @@ -6,7 +6,6 @@ import Utils from 'common/utils/utils' import PageTitle from 'components/PageTitle' import Tabs from 'components/navigation/TabMenu/Tabs' import TabItem from 'components/navigation/TabMenu/TabItem' -import Constants from 'common/constants' import { GeneralTab } from './tabs/general-tab' import { BillingTab } from './tabs/BillingTab' import { LicensingTab } from './tabs/LicensingTab' @@ -36,10 +35,6 @@ const OrganisationSettingsPage: FC = () => { { skip: !organisationId }, ) - useEffect(() => { - API.trackPage(Constants.pages.ORGANISATION_SETTINGS) - }, []) - // Back-compat: renamed tabs redirect so existing bookmarks and links land // in the right place (SAML became SSO; the API Keys tab became API Access // with the `keys` slug). diff --git a/frontend/web/components/pages/project-settings/ProjectSettingsPage.tsx b/frontend/web/components/pages/project-settings/ProjectSettingsPage.tsx index 4fa1644bde26..43d70960891d 100644 --- a/frontend/web/components/pages/project-settings/ProjectSettingsPage.tsx +++ b/frontend/web/components/pages/project-settings/ProjectSettingsPage.tsx @@ -1,11 +1,10 @@ -import React, { ReactNode, useEffect } from 'react' +import React, { ReactNode } from 'react' import PageTitle from 'components/PageTitle' import Tabs from 'components/navigation/TabMenu/Tabs' import TabItem from 'components/navigation/TabMenu/TabItem' import BetaFlag from 'components/BetaFlag' import { useGetProjectQuery } from 'common/services/useProject' import { useRouteContext } from 'components/providers/RouteContext' -import Constants from 'common/constants' import Utils from 'common/utils/utils' import ProjectUsageTab from './ProjectUsageTab' import EditHealthProvider from './tabs/EditHealthProvider' @@ -38,10 +37,6 @@ const ProjectSettingsPage = () => { { skip: !projectId }, ) - useEffect(() => { - API.trackPage(Constants.pages.PROJECT_SETTINGS) - }, []) - const isInitialLoading = isUninitialized || (isLoading && !project) if (isInitialLoading) { diff --git a/frontend/web/project/api.ts b/frontend/web/project/api.ts index 9567c29f467a..d6ad632f6f99 100644 --- a/frontend/web/project/api.ts +++ b/frontend/web/project/api.ts @@ -317,10 +317,6 @@ const API = { } }, - // Page views were only sent to Universal Analytics. Removed with its callers - // in a follow-up. - trackPage(): void {}, - trackTraits(traits: Record): void { try { if (Project.amplitude && traits) { From ee94af4146485ce0b377cad501a69151f968d99b Mon Sep 17 00:00:00 2001 From: Talisson Costa Date: Thu, 26 Nov 2026 11:34:29 -0300 Subject: [PATCH 2/2] chore(Tracking): Drop the unused API import Co-Authored-By: Claude Opus 5.5 --- .../pages/environment-settings/EnvironmentSettingsPage.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/web/components/pages/environment-settings/EnvironmentSettingsPage.tsx b/frontend/web/components/pages/environment-settings/EnvironmentSettingsPage.tsx index 7bf34e0cf227..e4ee0cdc0a94 100644 --- a/frontend/web/components/pages/environment-settings/EnvironmentSettingsPage.tsx +++ b/frontend/web/components/pages/environment-settings/EnvironmentSettingsPage.tsx @@ -27,7 +27,6 @@ import AddMetadataToEntity from 'components/metadata/AddMetadataToEntity' import { getSupportedContentType } from 'common/services/useSupportedContentType' import Format from 'common/utils/format' import Setting from 'components/Setting' -import API from 'project/api' import AppActions from 'common/dispatcher/app-actions' import { Environment, Webhook, Role } from 'common/types/responses' import PanelSearch from 'components/PanelSearch'