React-ga: What does testMode do?

Created on 22 Jan 2018  路  3Comments  路  Source: react-ga/react-ga

Hi there!

I see in the documentation that we have testMode: true available, but I can't really find any more information on what it does?

Ultimately I'm trying to see if I can enable GA only for production. So if testMode: true doesn't do it, is there a way to disable react-ga? Say based on a ENV VAR?

Thank you for your time!
Dimo

Most helpful comment

Sorry for long delay, see here: https://github.com/react-ga/react-ga#test-mode

All 3 comments

Yes testMode will let you do that. What it does is essentially prevent ga from being loaded or called. Instead all the calls are put in an array you can use for debugging.

I must have been a bit lazy in doc writing on this one.

Thank you @SimeonC for clarifying! I can confirm setting it to true doesn't send any tracking to GA!

When you say, _all the calls are put in array_, how can I access that array?

Thank you for your time!

Sorry for long delay, see here: https://github.com/react-ga/react-ga#test-mode

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kenjoe picture kenjoe  路  4Comments

TomasVink picture TomasVink  路  3Comments

achhranitesh picture achhranitesh  路  3Comments

astroana picture astroana  路  5Comments

nicolasiensen picture nicolasiensen  路  7Comments