ah of course you need to make getTracker().. Ended up doing it like this, got a compile will know later if it works:
// The following line should be changed to include the correct property id.
private static final String PROPERTY_ID = Prefs.GOOGLE_ANALYTICS_AGENT_ANDROID;// "UA-XXXXX-Y";
/**
* Enum used to identify the tracker that needs to be used for tracking.
*
* A single tracker is usually enough for most purposes. In case you do need multiple trackers,
* storing them all in Application object helps ensure that they are created only once per
* application instance.
*/
public enum TrackerName {
APP_TRACKER, // Tracker used only in this app.
GLOBAL_TRACKER, // Tracker used by all the apps from a company. eg: roll-up tracking.
ECOMMERCE_TRACKER, // Tracker used by all ecommerce transactions from a company.
}
HashMap<TrackerName, Tracker> mTrackers = new HashMap<TrackerName, Tracker>();
synchronized Tracker getTracker(TrackerName trackerId) {
if (!mTrackers.containsKey(trackerId)) {
GoogleAnalytics analytics = GoogleAnalytics.getInstance(AndroidNativeUtil.getActivity());
Tracker t = analytics.newTracker(PROPERTY_ID);
mTrackers.put(trackerId, t);
}
return mTrackers.get(trackerId);
}
public void doTracking() {
// Get tracker.
//getTracker() does not exist!!!
Tracker t = getTracker(TrackerName.APP_TRACKER);
// Set screen name.
t.setScreenName("Splash");//i didnt know what to put in here so i put splash for now since it should launch the app thorugh that each time anyway
t.send(new HitBuilders.ScreenViewBuilder()/*.setCampaignParamsFromUrl(campaignData)*/.build());