Skip to content

Commit 25747ea

Browse files
committed
move GA id to deploymeny variables
1 parent 8f7c6fd commit 25747ea

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
NEXT_PUBLIC_GA_MEASUREMENT_ID=G-JKZEHMJBMH
21
NEXT_PUBLIC_NODE_LIMIT=600
32
NEXT_TELEMETRY_DISABLED=1

.github/workflows/deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ jobs:
6767

6868
- name: Build with Next.js
6969
run: pnpm next build
70+
env:
71+
NEXT_PUBLIC_GA_MEASUREMENT_ID: ${{ vars.NEXT_PUBLIC_GA_MEASUREMENT_ID }}
7072

7173
- name: Upload Build Artifacts
7274
uses: actions/upload-artifact@v4

src/pages/_app.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ const theme = createTheme({
5252
},
5353
});
5454

55-
const IS_PROD = process.env.NODE_ENV === "production";
56-
5755
function JsonCrack({ Component, pageProps }: AppProps) {
5856
const { pathname } = useRouter();
5957

@@ -99,7 +97,7 @@ function JsonCrack({ Component, pageProps }: AppProps) {
9997
}}
10098
/>
10199
<GlobalStyle />
102-
{IS_PROD && <GoogleAnalytics trackPageViews />}
100+
{process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID && <GoogleAnalytics trackPageViews />}
103101
<Component {...pageProps} />
104102
</ThemeProvider>
105103
</MantineProvider>

0 commit comments

Comments
 (0)