使用Google Analytics(分析)进行Android崩溃和异常报告时超时

时间:2016-03-21 13:45:31

标签: java android google-analytics google-analytics-v4

在将匹配发送到服务器时看起来GA超时了。这是我在logcat中得到的:

D/GAv4    ( 5725): Hit delivery requested: ht=<numbers>, _s=32, _v=ma8.2.98, a=<numbers>, aid=<package>, an=<app name>, av=1.0, cid=<uuid>, exd=RuntimeException (@<my activity>:onCreate:96) {main}, exf=1, sr=720x1184, t=exception, tid=<tracker ID>, ul=en-us, v=1
D/GAv4    ( 5725): Sync dispatching local hits
W/GAv4    ( 5725): syncDispatchLocalHits timed out: java.util.concurrent.TimeoutException

为了更好的衡量,这就是我的设置看起来像(使用dagger2进行DI):

AppModule.java:

@Provides @Singleton Tracker providesGoogleAnalyticsTracker(App app) {
    return GoogleAnalytics.getInstance(app).newTracker(App.Constants.GOOGLE_ANALYTICS_ID);
}

App.java:

public class App extends Application {

    @Inject Tracker mGoogleAnalyticsTracker;

    @Override public void onCreate() {
        ...
        mGoogleAnalyticsTracker.enableExceptionReporting(true);
    }
}

0 个答案:

没有答案