react-ga4 icon indicating copy to clipboard operation
react-ga4 copied to clipboard

no gtagOption for debug_mode?

Open ezbeazy opened this issue 7 months ago • 1 comments

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;
}

ezbeazy avatar Jul 13 '24 20:07 ezbeazy