react-ga4
react-ga4 copied to clipboard
no gtagOption for debug_mode?
I don't see the gtag debug_mode option mapped to any parameter for ReactGA.initialize(). It also doesn't appear to be related to options.testMode, and I don't know what testMode is for since their is no description. Will the below not work? How can we use debug_mode? and what is options.testMode for?
export const initGA = (ga4Id: string, devMode: boolean) => {
ReactGA.initialize(ga4Id, {dev_mode: devMode});
};
if (
!window.GA_ANALYTICS &&
googleAnalyticsTrackingCode
){
if (apiHost.includes('localhost:'){
initGA(googleAnalyticsTrackingCode, true);
} else {
initGA(googleAnalyticsTrackingCode, false);
}
window.GA_ANALYTICS = true;
}