所以我使用angular和cordova谷歌分析插件
日志显示我已连接,但谷歌分析中的视图没有显示任何用户连接到我的应用程序。有人看到我缺了什么吗?
这就是我设置连接的方式:
var auth = JSON.parse(window.localStorage['auth'])
var userID = auth.userID;
$cordovaGoogleAnalytics.debugMode();
$cordovaGoogleAnalytics.startTrackerWithId('UA-55148678-1');
$cordovaGoogleAnalytics.setUserId(userID);
$cordovaGoogleAnalytics.trackView('We Alert Map');
这些是日志:
09-25 14:24:18.712: W/ContextImpl(31566): Failed to ensure directory: /storage/ext_sd/Android/data/nl.studionewmedia.wealert/files
09-25 14:24:18.712: W/ContextImpl(31566): Failed to ensure directory: /storage/ext_sd/Android/data/nl.studionewmedia.wealert/files
09-25 14:24:18.712: W/ContextImpl(31566): Failed to ensure directory: /storage/ext_sd/Android/data/nl.studionewmedia.wealert/cache
09-25 14:24:23.012: W/CordovaPlugin(31566): Attempted to send a second callback for ID: UniversalAnalytics712371046
09-25 14:24:23.012: W/CordovaPlugin(31566): Result was: "Invalid action"
09-25 14:24:23.022: V/GAV3(31566): Thread[JavaBridge,5,main]: Dispatch period set with null handler. Dispatch will run once initialization is complete.
09-25 14:24:23.022: W/CordovaPlugin(31566): Attempted to send a second callback for ID: UniversalAnalytics712371048
09-25 14:24:23.022: W/CordovaPlugin(31566): Result was: "Invalid action"
09-25 14:24:28.032: V/GAV3(31566): Thread[GAThread,5,main]: connecting to Analytics service
09-25 14:24:28.062: V/GAV3(31566): Thread[GAThread,5,main]: connect: bindService returned true for Intent { act=com.google.android.gms.analytics.service.START cmp=com.google.android.gms/.analytics.service.AnalyticsService (has extras) }
09-25 14:24:28.062: V/GAV3(31566): Thread[main,5,main]: service connected, binder: android.os.BinderProxy@41c5e138
09-25 14:24:28.072: V/GAV3(31566): Thread[main,5,main]: bound to service
09-25 14:24:28.072: V/GAV3(31566): Thread[GAThread,5,main]: Loaded clientId
09-25 14:24:28.072: V/GAV3(31566): Thread[main,5,main]: Connected to service
09-25 14:24:28.072: I/GAV3(31566): Thread[GAThread,5,main]: No campaign data found.
09-25 14:24:28.072: V/GAV3(31566): Thread[GAThread,5,main]: putHit called
09-25 14:24:28.072: V/GAV3(31566): Thread[GAThread,5,main]: Sending hit to service PATH: https: PARAMS: uid=2, v=1, ul=nl-nl, t=appview, ht=1411647863039, sr=1080x1776, an=WeAlert, tid=UA-55148678-1, aid=nl.studionewmedia.wealert, cid=349fa948-5bb3-4562-824e-3001b02cf401, av=0.0.1, _u=.KnoKoK-AL, cd=We Alert Map,
09-25 14:25:01.652: V/GAV3(31566): Thread[GAThread,5,main]: putHit called
09-25 14:25:01.652: V/GAV3(31566): Thread[GAThread,5,main]: Sending hit to service PATH: https: PARAMS: uid=2, v=1, ul=nl-nl, t=appview, ht=1411647901665, sr=1080x1776, an=WeAlert, tid=UA-55148678-1, aid=nl.studionewmedia.wealert, cid=349fa948-5bb3-4562-824e-3001b02cf401, av=0.0.1, _u=.r3oK-AL, cd=Volgend,
它也被包裹在中
ngCordova插件的扩展。
这与时间有关,分析实时视图似乎有3-7分钟的滞后。感谢@Eu.Dr指出这一点。将这个答案发布给未来的读者。