MNTOR-2832/fix ga4 debug mode (#4097)
* MNTOR-2832 - configure GA4 debug mode with build time env var
This commit is contained in:
Родитель
cef9bbf27c
Коммит
51ad8ab3bd
|
@ -170,3 +170,6 @@ NEXT_PUBLIC_GA4_MEASUREMENT_ID=G-CXG8K4KW4P
|
|||
# Used during CI to upload sourcemaps to Sentry.
|
||||
UPLOAD_SENTRY_SOURCEMAPS=false
|
||||
SENTRY_AUTH_TOKEN=
|
||||
|
||||
# Whether GA4 sends data or not. NOTE: must be set in build environment.
|
||||
NEXT_PUBLIC_GA4_DEBUG_MODE=true
|
||||
|
|
|
@ -52,7 +52,7 @@ export const useGa = (): {
|
|||
};
|
||||
} => {
|
||||
const debugMode =
|
||||
process.env.NEXT_PUBLIC_NODE_ENV !== "production" &&
|
||||
process.env.NEXT_PUBLIC_GA4_DEBUG_MODE === "true" &&
|
||||
process.env.NODE_ENV !== "test";
|
||||
|
||||
useEffect(() => {
|
||||
|
|
Загрузка…
Ссылка в новой задаче