remove some tracking

This commit is contained in:
ligi 2014-09-18 12:45:46 +02:00
parent e4c03beeea
commit 8122765b91
4 changed files with 1 additions and 48 deletions

View file

@ -1,10 +1,8 @@
package org.ligi.passandroid;
import android.support.v4.app.FragmentActivity;
public interface TrackerInterface {
public final static String EVENT_CATEGORY_UI_EVENT = "ui_event";
public final static String EVENT_CATEGORY_UI_ACTION = "ui_event";
void trackException(String s, Exception e, boolean fatal);
@ -13,7 +11,4 @@ public interface TrackerInterface {
void trackEvent(String category, String action, String label, Long val);
void activityStart(FragmentActivity activity);
void activityStop(FragmentActivity activity);
}

View file

@ -51,17 +51,4 @@ public class PassViewActivityBase extends ActionBarActivity {
return super.onOptionsItemSelected(item);
}
@Override
public void onStart() {
super.onStart();
Tracker.get().activityStart(this);
}
@Override
public void onStop() {
super.onStop();
Tracker.get().activityStop(this);
}
}

View file

@ -29,14 +29,4 @@ public class NotTracker implements TrackerInterface {
public void trackEvent(String category, String action, String label, Long val) {
}
@Override
public void activityStart(FragmentActivity activity) {
}
@Override
public void activityStop(FragmentActivity activity) {
}
}

View file

@ -1,7 +1,6 @@
package org.ligi.passandroid;
import android.content.Context;
import android.support.v4.app.FragmentActivity;
import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.HitBuilders;
@ -12,14 +11,12 @@ import java.util.Map;
public class AnalyticsTracker implements TrackerInterface {
public static final String PACKAGE_REMOVE_REGEX = ".*\\.";
private final GoogleAnalytics analytics;
private final Tracker tracker;
private final Context ctx;
public AnalyticsTracker(Context ctx) {
this.ctx = ctx;
analytics = GoogleAnalytics.getInstance(ctx);
final GoogleAnalytics analytics = GoogleAnalytics.getInstance(ctx);
tracker = analytics.newTracker(R.xml.analytics);
}
@ -63,20 +60,4 @@ public class AnalyticsTracker implements TrackerInterface {
tracker.send(eventMapBuilder.build());
}
@Override
public void activityStart(FragmentActivity activity) {
analytics.reportActivityStart(activity);
final String activityName = activity.getLocalClassName().replaceAll(PACKAGE_REMOVE_REGEX, "");
tracker.setScreenName(activityName);
tracker.send(new HitBuilders.AppViewBuilder().build());
}
@Override
public void activityStop(FragmentActivity activity) {
analytics.reportActivityStop(activity);
}
}