Google Analytics v4, track activities manually

61 views Asked by At

To prevent us reaching the request limit I want to disable tracking on some of my activities so I cannot use enableAutoActivityTracking.

When I want to track them manually I earlier had code in onStart and onStop but I cannot see how I can accomplish the same with the v4 library

I can always add:

@Override
protected void onStart() {
    super.onStart();
    mTracker.setScreenName(getClass().getSimpleName());
    mTracker.send(new HitBuilders.ScreenViewBuilder().build());
}

But don't I need the onStop code anymore? And should this code be in onStart? I couldn't find this in the new docs since it seems very focused on the automatic activity tracking.

0

There are 0 answers