How to programmatically set ga_trackingId property?

android, google-analytics, google-analytics-api

Solution

For changing the id for the EasyTracker, do this:

onStart()

EasyTracker.getInstance(this).set(Fields.TRACKING_ID, "<your_ga_id");
EasyTracker.getInstance(this).activityStart(this);

onStop()

EasyTracker.getInstance(this).activityStop(this);

Problem

I have a single app, but depending of user's choice, it will be monitored totally separated in google analytics, so I NEED to set "ga_trackingId" for EasyTracker programmatically. I've tried `EasyTracker.getTracker().setAppId(id)` with no luck.

Original source