0
votes

I want to track events to Google analytics from from my application. The problem is that I have limited options Category, Action, Label and Value.

// Get tracker.
Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()).getTracker(
    TrackerName.APP_TRACKER);
// Build and send an Event.
t.send(new HitBuilders.EventBuilder()
    .setCategory(getString(categoryId))
    .setAction(getString(actionId))
    .setLabel(getString(labelId))
    .build());

Is there any way to customize this event so that I can track event according to my preferences?

1

1 Answers

0
votes

Yes. You can add setCustomDimension for example:

    HitBuilders.EventBuilder eventBuilder = new HitBuilders.EventBuilder();
    eventBuilder.setCustomDimension(1, my_pref_1);
    eventBuilder.setCustomDimension(2, my_pref_1);
    eventBuilder.setCustomDimension(3, my_pref_1);