From bcd965448381638dbecbff9b54f6d66b509c34db Mon Sep 17 00:00:00 2001 From: Chase Fleming Date: Fri, 13 Dec 2024 15:44:13 -0800 Subject: [PATCH] Update to process.env (#1048) Co-authored-by: Chase Fleming <1666730+chasefleming@users.noreply.github.com> --- src/utils/gtags.client.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/gtags.client.ts b/src/utils/gtags.client.ts index 67688f3e39..add0ced525 100644 --- a/src/utils/gtags.client.ts +++ b/src/utils/gtags.client.ts @@ -15,7 +15,7 @@ declare global { * https://developers.google.com/analytics/devguides/collection/gtagjs/pages */ export const pageview = (url: string, trackingId: string) => { - if (window.ENV.NODE_ENV !== "production") return + if (process.env.NODE_ENV !== "production") return if (!window.gtag) { console.warn( @@ -43,7 +43,7 @@ export const event = ({ label?: string; value?: number | string; }) => { - if (window.ENV.NODE_ENV !== "production") return + if (process.env.NODE_ENV !== "production") return if (!window.gtag) { console.warn( @@ -59,7 +59,7 @@ export const event = ({ } export const reportWebVitalsToGA = (vitals: Metric) => { - if (window.ENV.NODE_ENV === "production") { + if (process.env.NODE_ENV === "production") { window.gtag("event", vitals.name, { ...vitals, value: vitals.delta, // Use `delta` so the value can be summed