Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no gtagOption for debug_mode? #79

Open
ezbeazy opened this issue Jul 13, 2024 · 2 comments
Open

no gtagOption for debug_mode? #79

ezbeazy opened this issue Jul 13, 2024 · 2 comments

Comments

@ezbeazy
Copy link

ezbeazy commented Jul 13, 2024

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
Copy link
Author

ezbeazy commented Jul 14, 2024

upon further inspection it appears gatagOptions does allow the flexibility to add options not explicitly mapped and I should be able to use the dev_mode option described in the "Monitor events in DebugView" help article. Is that correct?

@KrisLau
Copy link

KrisLau commented Oct 31, 2024

Did you ever figure it out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants