Android : Using Google Analytics V4 To Track Fragment?
How can we track fragment with google analytics v4 ? Here is my application class: public class MyApplication extends Application { private static final String PROPERTY_ID = 'U
Solution 1:
Trackert= ((AnalyticsSampleApp) getActivity().getApplication()).getTracker(
TrackerName.APP_TRACKER);
t.setScreenName("FRAGMENT_NAME");
t.send(newHitBuilders.AppViewBuilder().build());
This way should suit your needs, isn't it?
or go this way:
t.send(new HitBuilders.EventBuilder()
.setCategory("Category")
.setAction("Action_Id")
.setLabel("Label")
.build());
Post a Comment for "Android : Using Google Analytics V4 To Track Fragment?"