I want to disable logging Google Analytics (GA) events when the app is running in Debug mode. So, I implemented the following:
if (BuildConfig.DEBUG) {
//Disables reporting when app runs on debug
GoogleAnalytics.getInstance(context).setDryRun(true);
}
It works fine with every "Google" Android phone I tested (i.e., does NOT report events while debugging app), but it does NOT work with the Amazon Fire Phone (i.e., Fire Phone still reports events while debugging - perhaps because it doesn't have Google Play Services installed?).
All events are properly reported to GA, so GA in general is working on the Fire Phone- but, GoogleAnalytics.setDryRun(true)
does not have any effect.
This issue has also been posted to the Google Product Forum for Google Analytics: https://productforums.google.com/forum/#!topic/analytics/1zAmZCu1Bx4
Here is Google Analytics Logs:
V/GAV4﹕ Thread[main,5,main]: [Tracker] trackingId loaded: UA-XXXXXXXX
V/GAV4﹕ Thread[main,5,main]: [Tracker] sample frequency loaded:
W/GAV4﹕ Thread[main,5,main]: bool configuration name not recognized: ga_dryRun
W/GAV4﹕ Thread[main,5,main]: bool configuration name not recognized: ga_dryRun
Here is the open-source project: