diff --git a/studio/hooks/misc/useStore.tsx b/studio/hooks/misc/useStore.tsx index 0c7072a0381..2248cda5eee 100644 --- a/studio/hooks/misc/useStore.tsx +++ b/studio/hooks/misc/useStore.tsx @@ -73,23 +73,6 @@ export const StoreProvider: FC = ({ children, rootStore }) => { } } }) - - /** - * get Ga4 client_id when it's available - * */ - // @ts-ignore - if (!!window?.gtag) { - // @ts-ignore - window?.gtag( - 'get', - `${process.env.NEXT_PUBLIC_GA4_MEASUREMENT_ID}`, - 'client_id', - // @ts-ignore - (client_id) => { - ui.setGaClientId(client_id) - } - ) - } }, []) return {children} diff --git a/studio/lib/common/fetch/base.ts b/studio/lib/common/fetch/base.ts index 4116526bf6b..7acd51d1dae 100644 --- a/studio/lib/common/fetch/base.ts +++ b/studio/lib/common/fetch/base.ts @@ -111,10 +111,5 @@ export async function constructHeaders(requestId: string, optionHeaders?: { [pro if (accessToken) headers.Authorization = `Bearer ${accessToken}` } - if (typeof window !== 'undefined') { - const gaClientId = window?.localStorage?.getItem('ga_client_id') - if (gaClientId && gaClientId !== 'undefined') headers['X-GA-Client-Id'] = gaClientId - } - return headers } diff --git a/studio/pages/_app.tsx b/studio/pages/_app.tsx index c800be4a192..8a9144cf26f 100644 --- a/studio/pages/_app.tsx +++ b/studio/pages/_app.tsx @@ -22,7 +22,6 @@ import relativeTime from 'dayjs/plugin/relativeTime' import Prism from 'prism-react-renderer/prism' import Head from 'next/head' -import Script from 'next/script' import { AppPropsWithLayout } from 'types' import { ThemeProvider } from 'common' @@ -133,20 +132,6 @@ function CustomApp({ Component, pageProps }: AppPropsWithLayout) { - - diff --git a/studio/stores/UiStore.ts b/studio/stores/UiStore.ts index 46a522e6b21..1b91898ae31 100644 --- a/studio/stores/UiStore.ts +++ b/studio/stores/UiStore.ts @@ -19,7 +19,6 @@ export interface IUiStore { setNotification: (notification: Notification) => string setProfile: (value: User) => void setPermissions: (permissions?: Permission[]) => void - setGaClientId: (clientId?: string) => void } export default class UiStore implements IUiStore { rootStore: IRootStore @@ -117,13 +116,4 @@ export default class UiStore implements IUiStore { setPermissions(permissions?: any) { this.permissions = permissions } - - setGaClientId(clientId?: string) { - /** - * We need to access ga client_id from base.constructHeaders method - * in order to set custom header('ga_client_id). - * TODO: Do we have a better way than storing in local storage? - */ - window.localStorage.setItem('ga_client_id', String(clientId)) - } }