Skip to content

Commit 2a18499

Browse files
authored
chore: remove google analytics (#7293)
1 parent 02a1f71 commit 2a18499

File tree

5 files changed

+1
-46
lines changed

5 files changed

+1
-46
lines changed

packages/web/app/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ The following environment variables configure the application.
2626
| `SENTRY_ENABLED` | No | Whether Sentry error reporting should be enabled. | `1` (enabled) or `0` (disabled) |
2727
| `DOCS_URL` | No | The URL of the Hive Docs | `https://the-guild.dev/graphql/hive/docs` |
2828
| `NODE_ENV` | No | The `NODE_ENV` value. | `production` |
29-
| `GA_TRACKING_ID` | No | The token for Google Analytics in order to track user actions. | `g6aff8102efda5e1d12e` |
3029
| `GRAPHQL_PERSISTED_OPERATIONS` | No | Send persisted operation hashes instead of documents to the server. | `1` (enabled) or `0` (disabled) |
3130

3231
## Hive Hosted Configuration

packages/web/app/src/env/frontend-public-variables.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export const ALLOWED_ENVIRONMENT_VARIABLES = [
88
'GRAPHQL_PUBLIC_ENDPOINT',
99
'GRAPHQL_PUBLIC_SUBSCRIPTION_ENDPOINT',
1010
'GRAPHQL_PUBLIC_ORIGIN',
11-
'GA_TRACKING_ID',
1211
'DOCS_URL',
1312
'STRIPE_PUBLIC_KEY',
1413
'RELEASE',

packages/web/app/src/env/frontend.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ const BaseSchema = protectedObject({
4343
GRAPHQL_PUBLIC_ENDPOINT: zod.string().url(),
4444
GRAPHQL_PUBLIC_SUBSCRIPTION_ENDPOINT: zod.string().url(),
4545
GRAPHQL_PUBLIC_ORIGIN: zod.string().url(),
46-
GA_TRACKING_ID: emptyString(zod.string().optional()),
4746
DOCS_URL: emptyString(zod.string().url().optional()),
4847
STRIPE_PUBLIC_KEY: emptyString(zod.string().optional()),
4948
RELEASE: emptyString(zod.string().optional()),
@@ -155,9 +154,6 @@ function buildConfig() {
155154
requireEmailVerification: base.AUTH_REQUIRE_EMAIL_VERIFICATION === '1',
156155
oidc: authOktaMultiTenant.AUTH_ORGANIZATION_OIDC === '1',
157156
},
158-
analytics: {
159-
googleAnalyticsTrackingId: base.GA_TRACKING_ID,
160-
},
161157
integrations: {
162158
slack: integrationSlack.INTEGRATION_SLACK === '1',
163159
},

packages/web/app/src/lib/gtag.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

packages/web/app/src/router.tsx

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { lazy, useCallback, useEffect, useMemo } from 'react';
22
import { parse as jsUrlParse, stringify as jsUrlStringify } from 'jsurl2';
3-
import { Helmet, HelmetProvider } from 'react-helmet-async';
3+
import { HelmetProvider } from 'react-helmet-async';
44
import { ToastContainer } from 'react-toastify';
55
import SuperTokens, { SuperTokensWrapper } from 'supertokens-auth-react';
66
import Session from 'supertokens-auth-react/recipe/session';
@@ -10,7 +10,6 @@ import { LoadingAPIIndicator } from '@/components/common/LoadingAPI';
1010
import { Toaster } from '@/components/ui/toaster';
1111
import { frontendConfig } from '@/config/supertokens/frontend';
1212
import { env } from '@/env/frontend';
13-
import * as gtag from '@/lib/gtag';
1413
import { urqlClient } from '@/lib/urql';
1514
import { configureScope, init } from '@sentry/react';
1615
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
@@ -121,24 +120,6 @@ function RootComponent() {
121120

122121
return (
123122
<HelmetProvider>
124-
{env.analytics.googleAnalyticsTrackingId && (
125-
<Helmet>
126-
<script id="gtag-init" key="gtag-init" type="text/javascript">{`
127-
window.dataLayer = window.dataLayer || [];
128-
function gtag(){dataLayer.push(arguments);}
129-
gtag('js', new Date());
130-
gtag('config', '${env.analytics.googleAnalyticsTrackingId}', {
131-
page_path: window.location.pathname,
132-
});
133-
`}</script>
134-
<script
135-
key="gtag-script"
136-
async
137-
src={`https://www.googletagmanager.com/gtag/js?id=${env.analytics.googleAnalyticsTrackingId}`}
138-
type="text/javascript"
139-
/>
140-
</Helmet>
141-
)}
142123
<Toaster />
143124
<SuperTokensWrapper>
144125
<QueryClientProvider client={queryClient}>
@@ -985,7 +966,3 @@ export const router = createRouter({
985966
return JSON.stringify(search);
986967
}),
987968
});
988-
989-
router.history.subscribe(() => {
990-
gtag.pageview(router.history.location.href);
991-
});

0 commit comments

Comments
 (0)