File tree Expand file tree Collapse file tree 3 files changed +107
-786
lines changed
client/modules/User/components Expand file tree Collapse file tree 3 files changed +107
-786
lines changed Original file line number Diff line number Diff line change @@ -106,16 +106,18 @@ function CookieConsent() {
106
106
initializeCookieConsent ( ) ;
107
107
}
108
108
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 ) ;
117
120
}
118
- ReactGA . pageview ( window . location . pathname + window . location . search ) ;
119
121
} , [ ] ) ;
120
122
121
123
useEffect ( ( ) => {
You can’t perform that action at this time.
0 commit comments