public void activityStart(Activity activity) { try { mTracker.setScreenName(activity.getClass().getSimpleName()); ScreenViewBuilder builder = new ScreenViewBuilder(); builder.set(SCREEN_NAME, activity.getClass().getSimpleName()); Intent intent = activity.getIntent(); if (intent != null) { Uri data = intent.getData(); if (data != null) { builder.setAll(getReferrerMapFromUri(data)); } } mTracker.send(builder.build()); } catch (Throwable t) { if (AndroidUtils.DEBUG) { Log.e(TAG, "activityStart", t); } } }
public void fragmentStart(@Nullable Fragment fragment, String name) { try { mTracker.setScreenName(name); ScreenViewBuilder builder = new ScreenViewBuilder(); builder.set(SCREEN_NAME, name); mTracker.send(builder.build()); } catch (Throwable t) { if (AndroidUtils.DEBUG) { Log.e(TAG, "fragmentStart", t); } } }
/** * Inform a screen hit to Google Analytics * * @param screenName A name for the screen */ public void sendScreenHit(String screenName) { mApplicationTracker.setScreenName(screenName); final ScreenViewBuilder screenViewBuilder = new ScreenViewBuilder(); screenViewBuilder.set(ParamKeys.LOGGED_IN, TextUtils .isEmpty(UserInfo.INSTANCE.getId()) ? ParamValues.NO : ParamValues.YES); mApplicationTracker.send(screenViewBuilder.build()); }
public static void sendView(final String pScreenName) { AnalyticsHelper.sTracker.setScreenName(pScreenName); AnalyticsHelper.sTracker.send(new ScreenViewBuilder().build()); AnalyticsHelper.sTracker.setScreenName(null); }
/** * Send a screen opening event. * * @param object The activity or fragment showing the screen. */ public static void sendScreen(final Object object) { getDefaultTracker(); mTracker.setScreenName(object.getClass().getSimpleName()); mTracker.send(new ScreenViewBuilder().build()); }
/** * Start a new session. */ public static void startSession() { mTracker.send(new ScreenViewBuilder().setNewSession().build()); }