Ga_autoActivityTracking = true: exclude certain actions from reports

[For Android Google Analytics v4]

Is there a way for certain actions not to be reported (sending a hit to the service) when ga_autoActivityTracking = true?

I was thinking about ga_autoActivityTracking false in onStart () and true again on onStop () in specific actions. If possible, someone will be as kind as providing the sample code. Other approaches are also welcome.

Thanks.

+6
source share
1 answer

When using the autoActivityTracking function, you cannot exclude some actions from the report, unfortunately. The only way to do this is to turn off automatic activity tracking and manually send a screen view from Activity.onStart ():

tracker.setScreenName("screen name"); tracker.send(new HitBuilders.ScreenViewBuilder().build()); 

You cannot turn off activity tracking with onStart () since the callback list will be blocked by Android before the callbacks are made. Any change to the list will not affect the list of registered callbacks for this onStart (). Unfortunately, disabling automatic activity tracking from onStart will not work.

+3
source

Source: https://habr.com/ru/post/975469/