diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ba92f9f28f..0601aaf532 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,9 +11,9 @@ jobs: check-no-ee-references: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Run check - run: make check-no-ee-references + - uses: actions/checkout@v4 + - name: Run check + run: make check-no-ee-references build-frontend: runs-on: ubuntu-latest @@ -42,7 +42,6 @@ jobs: - name: Create .env file run: | echo 'INTERCOM_APP_ID="${{ secrets.INTERCOM_APP_ID }}"' > frontend/.env - echo 'SEGMENT_ID="${{ secrets.SEGMENT_ID }}"' >> frontend/.env echo 'CLARITY_PROJECT_ID="${{ secrets.CLARITY_PROJECT_ID }}"' >> frontend/.env - name: Install dependencies run: cd frontend && yarn install diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 7808f9d18e..87762e2ff1 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -9,7 +9,6 @@ on: - v* jobs: - image-build-and-push-query-service: runs-on: ubuntu-latest steps: @@ -150,7 +149,6 @@ jobs: - name: Create .env file run: | echo 'INTERCOM_APP_ID="${{ secrets.INTERCOM_APP_ID }}"' > frontend/.env - echo 'SEGMENT_ID="${{ secrets.SEGMENT_ID }}"' >> frontend/.env echo 'CLARITY_PROJECT_ID="${{ secrets.CLARITY_PROJECT_ID }}"' >> frontend/.env echo 'SENTRY_AUTH_TOKEN="${{ secrets.SENTRY_AUTH_TOKEN }}"' >> frontend/.env echo 'SENTRY_ORG="${{ secrets.SENTRY_ORG }}"' >> frontend/.env diff --git a/frontend/src/AppRoutes/index.tsx b/frontend/src/AppRoutes/index.tsx index b900255172..74b3561afe 100644 --- a/frontend/src/AppRoutes/index.tsx +++ b/frontend/src/AppRoutes/index.tsx @@ -8,7 +8,6 @@ import { FeatureKeys } from 'constants/features'; import { LOCALSTORAGE } from 'constants/localStorage'; import ROUTES from 'constants/routes'; import AppLayout from 'container/AppLayout'; -import useAnalytics from 'hooks/analytics/useAnalytics'; import { KeyboardHotkeysProvider } from 'hooks/hotkeys/useKeyboardHotkeys'; import { useIsDarkMode, useThemeConfig } from 'hooks/useDarkMode'; import { THEME_MODE } from 'hooks/useDarkMode/constant'; @@ -17,7 +16,7 @@ import useLicense, { LICENSE_PLAN_KEY } from 'hooks/useLicense'; import { NotificationProvider } from 'hooks/useNotifications'; import { ResourceProvider } from 'hooks/useResourceAttribute'; import history from 'lib/history'; -import { identity, pick, pickBy } from 'lodash-es'; +import { pick } from 'lodash-es'; import posthog from 'posthog-js'; import AlertRuleProvider from 'providers/Alert'; import { DashboardProvider } from 'providers/Dashboard/Dashboard'; @@ -50,9 +49,7 @@ function App(): JSX.Element { const dispatch = useDispatch>(); - const { trackPageView } = useAnalytics(); - - const { hostname, pathname } = window.location; + const { hostname } = window.location; const isCloudUserVal = isCloudUser(); @@ -114,29 +111,9 @@ function App(): JSX.Element { const { name, email } = user; - const identifyPayload = { - email, - name, - company_name: orgName, - role, - source: 'signoz-ui', - }; - - const sanitizedIdentifyPayload = pickBy(identifyPayload, identity); const domain = extractDomain(email); const hostNameParts = hostname.split('.'); - const groupTraits = { - name: orgName, - tenant_id: hostNameParts[0], - data_region: hostNameParts[1], - tenant_url: hostname, - company_domain: domain, - source: 'signoz-ui', - }; - - window.analytics.identify(email, sanitizedIdentifyPayload); - window.analytics.group(domain, groupTraits); window.clarity('identify', email, name); posthog?.identify(email, { @@ -197,11 +174,6 @@ function App(): JSX.Element { // eslint-disable-next-line react-hooks/exhaustive-deps }, [isLoggedInState, isOnBasicPlan, user]); - useEffect(() => { - trackPageView(pathname); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [pathname]); - useEffect(() => { if (user && user?.email && user?.userId && user?.name) { try { diff --git a/frontend/src/hooks/analytics/useAnalytics.tsx b/frontend/src/hooks/analytics/useAnalytics.tsx deleted file mode 100644 index e3d2081766..0000000000 --- a/frontend/src/hooks/analytics/useAnalytics.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { useSelector } from 'react-redux'; -import { AppState } from 'store/reducers'; -import AppReducer from 'types/reducer/app'; -import { extractDomain } from 'utils/app'; - -const useAnalytics = (): any => { - const { user } = useSelector((state) => state.app); - - // Segment Page View - analytics.page([category], [name], [properties], [options], [callback]); - const trackPageView = (pageName: string): void => { - if (user && user.email) { - window.analytics.page(null, pageName, { - userId: user.email, - }); - } - }; - - const trackEvent = ( - eventName: string, - properties?: Record, - ): void => { - if (user && user.email) { - const context = { - context: { - groupId: extractDomain(user?.email), - }, - }; - - const updatedProperties = { ...properties }; - updatedProperties.userId = user.email; - window.analytics.track(eventName, properties, context); - } - }; - - return { trackPageView, trackEvent }; -}; - -export default useAnalytics; diff --git a/frontend/src/index.html.ejs b/frontend/src/index.html.ejs index 8a4e407ec5..923b9dafa5 100644 --- a/frontend/src/index.html.ejs +++ b/frontend/src/index.html.ejs @@ -132,78 +132,5 @@ y.parentNode.insertBefore(t, y); })(window, document, 'clarity', 'script', CLARITY_PROJECT_ID); - - diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js index 8fc1188448..d92ee05a1c 100644 --- a/frontend/webpack.config.js +++ b/frontend/webpack.config.js @@ -21,7 +21,6 @@ const plugins = [ new HtmlWebpackPlugin({ template: 'src/index.html.ejs', INTERCOM_APP_ID: process.env.INTERCOM_APP_ID, - SEGMENT_ID: process.env.SEGMENT_ID, POSTHOG_KEY: process.env.POSTHOG_KEY, CLARITY_PROJECT_ID: process.env.CLARITY_PROJECT_ID, SENTRY_AUTH_TOKEN: process.env.SENTRY_AUTH_TOKEN, @@ -40,7 +39,6 @@ const plugins = [ FRONTEND_API_ENDPOINT: process.env.FRONTEND_API_ENDPOINT, WEBSOCKET_API_ENDPOINT: process.env.WEBSOCKET_API_ENDPOINT, INTERCOM_APP_ID: process.env.INTERCOM_APP_ID, - SEGMENT_ID: process.env.SEGMENT_ID, POSTHOG_KEY: process.env.POSTHOG_KEY, CLARITY_PROJECT_ID: process.env.CLARITY_PROJECT_ID, SENTRY_AUTH_TOKEN: process.env.SENTRY_AUTH_TOKEN, diff --git a/frontend/webpack.config.prod.js b/frontend/webpack.config.prod.js index f9af80bcf5..6f72518152 100644 --- a/frontend/webpack.config.prod.js +++ b/frontend/webpack.config.prod.js @@ -26,7 +26,6 @@ const plugins = [ new HtmlWebpackPlugin({ template: 'src/index.html.ejs', INTERCOM_APP_ID: process.env.INTERCOM_APP_ID, - SEGMENT_ID: process.env.SEGMENT_ID, POSTHOG_KEY: process.env.POSTHOG_KEY, CLARITY_PROJECT_ID: process.env.CLARITY_PROJECT_ID, SENTRY_AUTH_TOKEN: process.env.SENTRY_AUTH_TOKEN, @@ -50,7 +49,6 @@ const plugins = [ FRONTEND_API_ENDPOINT: process.env.FRONTEND_API_ENDPOINT, WEBSOCKET_API_ENDPOINT: process.env.WEBSOCKET_API_ENDPOINT, INTERCOM_APP_ID: process.env.INTERCOM_APP_ID, - SEGMENT_ID: process.env.SEGMENT_ID, POSTHOG_KEY: process.env.POSTHOG_KEY, CLARITY_PROJECT_ID: process.env.CLARITY_PROJECT_ID, SENTRY_AUTH_TOKEN: process.env.SENTRY_AUTH_TOKEN,