Track view Google Analytics

460 views Asked by At

I have an Android application in which I want to track views. I am not sure if these are considered page views but I don't think they are.

Could someone tell me how to load a tracker so that the events sent would be sent to that specific view?

I have set up the tracking id and other event information.

tracker = analytics.newTracker(UA_TRACKER_ID);
tracker.setScreenName(screen);


if (tracker != null) {
    tracker.enableExceptionReporting(true);
    tracker.enableAdvertisingIdCollection(true);
    tracker.enableAutoActivityTracking(true);
    tracker.setScreenName("screen name");
    tracker.setAppName("app name");
    tracker.send(new HitBuilders.EventBuilder()
            .set("&cs", "campaign source")
            .set("&ck", "campaign stuff")
            .setCategory(category)

            .setAction(action)
            .setLabel(label)
            .build());
}
1

There are 1 answers

0
Hades On BEST ANSWER

The issue was because I was manually setting the campaign source which in turn was resetting my type.

I fixed it by adding

.set("&t", "event")