Skip to content

Commit a9bbffd

Browse files
committed
Downgrade remark libraries, check if GA_MEASUREMENT_ID is defined
1 parent 480bce6 commit a9bbffd

File tree

3 files changed

+107
-786
lines changed

3 files changed

+107
-786
lines changed

client/modules/User/components/CookieConsent.jsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,18 @@ function CookieConsent() {
106106
initializeCookieConsent();
107107
}
108108

109-
if (p5CookieConsent === 'essential') {
110-
ReactGA.initialize(getConfig('GA_MEASUREMENT_ID'), {
111-
gaOptions: {
112-
storage: 'none'
113-
}
114-
});
115-
} else {
116-
ReactGA.initialize(getConfig('GA_MEASUREMENT_ID'));
109+
if (getConfig('GA_MEASUREMENT_ID')) {
110+
if (p5CookieConsent === 'essential') {
111+
ReactGA.initialize(getConfig('GA_MEASUREMENT_ID'), {
112+
gaOptions: {
113+
storage: 'none'
114+
}
115+
});
116+
} else {
117+
ReactGA.initialize(getConfig('GA_MEASUREMENT_ID'));
118+
}
119+
ReactGA.pageview(window.location.pathname + window.location.search);
117120
}
118-
ReactGA.pageview(window.location.pathname + window.location.search);
119121
}, []);
120122

121123
useEffect(() => {

0 commit comments

Comments
 (0)