mirror of
https://github.com/graphql-hive/console
synced 2026-04-21 14:37:17 +00:00
chore: remove google analytics (#7293)
This commit is contained in:
parent
02a1f71a13
commit
2a18499342
5 changed files with 1 additions and 46 deletions
|
|
@ -26,7 +26,6 @@ The following environment variables configure the application.
|
|||
| `SENTRY_ENABLED` | No | Whether Sentry error reporting should be enabled. | `1` (enabled) or `0` (disabled) |
|
||||
| `DOCS_URL` | No | The URL of the Hive Docs | `https://the-guild.dev/graphql/hive/docs` |
|
||||
| `NODE_ENV` | No | The `NODE_ENV` value. | `production` |
|
||||
| `GA_TRACKING_ID` | No | The token for Google Analytics in order to track user actions. | `g6aff8102efda5e1d12e` |
|
||||
| `GRAPHQL_PERSISTED_OPERATIONS` | No | Send persisted operation hashes instead of documents to the server. | `1` (enabled) or `0` (disabled) |
|
||||
|
||||
## Hive Hosted Configuration
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ export const ALLOWED_ENVIRONMENT_VARIABLES = [
|
|||
'GRAPHQL_PUBLIC_ENDPOINT',
|
||||
'GRAPHQL_PUBLIC_SUBSCRIPTION_ENDPOINT',
|
||||
'GRAPHQL_PUBLIC_ORIGIN',
|
||||
'GA_TRACKING_ID',
|
||||
'DOCS_URL',
|
||||
'STRIPE_PUBLIC_KEY',
|
||||
'RELEASE',
|
||||
|
|
|
|||
4
packages/web/app/src/env/frontend.ts
vendored
4
packages/web/app/src/env/frontend.ts
vendored
|
|
@ -43,7 +43,6 @@ const BaseSchema = protectedObject({
|
|||
GRAPHQL_PUBLIC_ENDPOINT: zod.string().url(),
|
||||
GRAPHQL_PUBLIC_SUBSCRIPTION_ENDPOINT: zod.string().url(),
|
||||
GRAPHQL_PUBLIC_ORIGIN: zod.string().url(),
|
||||
GA_TRACKING_ID: emptyString(zod.string().optional()),
|
||||
DOCS_URL: emptyString(zod.string().url().optional()),
|
||||
STRIPE_PUBLIC_KEY: emptyString(zod.string().optional()),
|
||||
RELEASE: emptyString(zod.string().optional()),
|
||||
|
|
@ -155,9 +154,6 @@ function buildConfig() {
|
|||
requireEmailVerification: base.AUTH_REQUIRE_EMAIL_VERIFICATION === '1',
|
||||
oidc: authOktaMultiTenant.AUTH_ORGANIZATION_OIDC === '1',
|
||||
},
|
||||
analytics: {
|
||||
googleAnalyticsTrackingId: base.GA_TRACKING_ID,
|
||||
},
|
||||
integrations: {
|
||||
slack: integrationSlack.INTEGRATION_SLACK === '1',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
import { env } from '@/env/frontend';
|
||||
|
||||
export const pageview = (url: string): void => {
|
||||
if (!env.analytics.googleAnalyticsTrackingId) {
|
||||
return;
|
||||
}
|
||||
const gtag = (window as any).gtag;
|
||||
|
||||
if (typeof gtag === 'function') {
|
||||
gtag('config', env.analytics.googleAnalyticsTrackingId, {
|
||||
page_path: url,
|
||||
});
|
||||
} else {
|
||||
console.error('window.gtag function not found');
|
||||
}
|
||||
};
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { lazy, useCallback, useEffect, useMemo } from 'react';
|
||||
import { parse as jsUrlParse, stringify as jsUrlStringify } from 'jsurl2';
|
||||
import { Helmet, HelmetProvider } from 'react-helmet-async';
|
||||
import { HelmetProvider } from 'react-helmet-async';
|
||||
import { ToastContainer } from 'react-toastify';
|
||||
import SuperTokens, { SuperTokensWrapper } from 'supertokens-auth-react';
|
||||
import Session from 'supertokens-auth-react/recipe/session';
|
||||
|
|
@ -10,7 +10,6 @@ import { LoadingAPIIndicator } from '@/components/common/LoadingAPI';
|
|||
import { Toaster } from '@/components/ui/toaster';
|
||||
import { frontendConfig } from '@/config/supertokens/frontend';
|
||||
import { env } from '@/env/frontend';
|
||||
import * as gtag from '@/lib/gtag';
|
||||
import { urqlClient } from '@/lib/urql';
|
||||
import { configureScope, init } from '@sentry/react';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
|
|
@ -121,24 +120,6 @@ function RootComponent() {
|
|||
|
||||
return (
|
||||
<HelmetProvider>
|
||||
{env.analytics.googleAnalyticsTrackingId && (
|
||||
<Helmet>
|
||||
<script id="gtag-init" key="gtag-init" type="text/javascript">{`
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '${env.analytics.googleAnalyticsTrackingId}', {
|
||||
page_path: window.location.pathname,
|
||||
});
|
||||
`}</script>
|
||||
<script
|
||||
key="gtag-script"
|
||||
async
|
||||
src={`https://www.googletagmanager.com/gtag/js?id=${env.analytics.googleAnalyticsTrackingId}`}
|
||||
type="text/javascript"
|
||||
/>
|
||||
</Helmet>
|
||||
)}
|
||||
<Toaster />
|
||||
<SuperTokensWrapper>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
|
|
@ -985,7 +966,3 @@ export const router = createRouter({
|
|||
return JSON.stringify(search);
|
||||
}),
|
||||
});
|
||||
|
||||
router.history.subscribe(() => {
|
||||
gtag.pageview(router.history.location.href);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue