Google Analytics V2不logging来自Android应用的统计信息

我正在使用适用于Android V2.0 beta 3的SDK中的EasyTracker。我已经遵循https://developers.google.com/analytics/devguides/collection/android/v2/中介绍的所有步骤,并确保在我的ga_trackingId参数值中有连字符而不是连字符。

我已经在Android 2.2和4.1.2以及真实设备上的模拟器中尝试过我的应用程序。 这是来自LogCat的(部分编辑)输出:

11-17 20:13:50.587: W/GAV2(542): Thread[main,5,main]: Connection to service failed 1 11-17 20:13:50.616: W/GAV2(542): Thread[main,5,main]: Need to call initialize() and be in fallback mode to start dispatch. 11-17 20:13:50.616: I/GAV2(542): Thread[main,5,main]: ExceptionReporter created, original handler is com.android.internal.os.RuntimeInit$UncaughtHandler 11-17 20:13:52.617: I/GAV2(542): Thread[GAThread,5,main]: No campaign data found. 11-17 20:13:52.646: I/GAV2(542): Thread[GAThread,5,main]: putHit called 11-17 20:13:55.606: I/GAV2(542): Thread[Service Reconnect,5,main]: connecting to Analytics service 11-17 20:13:55.616: I/GAV2(542): Thread[Service Reconnect,5,main]: connect: bindService returned false for Intent { act=com.google.android.gms.analytics.service.START (has extras) } 11-17 20:13:55.616: W/GAV2(542): Thread[Service Reconnect,5,main]: Connection to service failed 1 11-17 20:13:55.616: I/GAV2(542): Thread[Service Reconnect,5,main]: falling back to local store 11-17 20:13:55.635: I/GAV2(542): Thread[GAThread,5,main]: Sending hit to store 11-17 20:13:55.666: I/GAV2(542): Thread[GAThread,5,main]: PowerSaveMode initiated. 11-17 20:13:55.696: I/GAV2(542): Thread[GAThread,5,main]: PowerSaveMode terminated. 11-17 20:13:55.696: V/GAV2(542): Thread[GAThread,5,main]: dispatch running... 11-17 20:13:55.746: I/GAV2(542): Thread[GAThread,5,main]: User-Agent: GoogleAnalytics/2.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) 11-17 20:13:55.746: I/GAV2(542): Host: www.google-analytics.com 11-17 20:13:55.746: I/GAV2(542): GET /collect?ul=en-us&sr=480x800&a=935594353&sc=start&aid=com.xxx.android&cid=2b8c0c5de52ba05e&av=1.0&v=1&t=appview&an=xxx&tid=UA-xxx-55&_u=.nUWlMB&_v=ma1b3&cd=com.xxx.android.MainActivity&qt=5123&z=184 HTTP/1.1 11-17 20:13:56.116: V/GAV2(542): Thread[GAThread,5,main]: sent 1 of 1 hits 11-17 20:13:56.126: I/GAV2(542): Thread[GAThread,5,main]: PowerSaveMode initiated. ... 11-17 20:15:09.206: V/GAV2(542): Thread[GAThread,5,main]: dispatch running... 11-17 20:15:09.206: V/GAV2(542): Thread[GAThread,5,main]: ...nothing to dispatch 11-17 20:15:09.256: I/GAV2(542): Thread[GAThread,5,main]: putHit called 11-17 20:15:09.256: I/GAV2(542): Thread[GAThread,5,main]: Sending hit to store 11-17 20:15:09.316: I/GAV2(542): Thread[GAThread,5,main]: PowerSaveMode terminated. 11-17 20:15:11.706: V/GAV2(542): Thread[GAThread,5,main]: dispatch running... 11-17 20:15:11.716: I/GAV2(542): Thread[GAThread,5,main]: User-Agent: GoogleAnalytics/2.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) 11-17 20:15:11.716: I/GAV2(542): Host: www.google-analytics.com 11-17 20:15:11.716: I/GAV2(542): GET /collect?v=1&ul=en-us&t=appview&sr=480x800&an=xxx&a=448166238&tid=UA-xxx-55&aid=com.xxx.android&cid=2b8c0c5de52ba05e&_u=.sB&av=1.0&_v=ma1b3&cd=com.xxx.android.ProductActivity&qt=2500&z=185 HTTP/1.1 11-17 20:15:11.986: V/GAV2(542): Thread[GAThread,5,main]: sent 1 of 1 hits 11-17 20:15:12.006: I/GAV2(542): Thread[GAThread,5,main]: PowerSaveMode initiated. 

我已经通过了所有相关的职位。

根据这个: http : //blog.blundell-apps.com/google-analytics-common-problems-and-fixes/ ,我看到“…没有任何派遣”的事实表明数据发送。

我并不担心“连接到服务失败1”警告,因为它并没有停止为其他人logging分析数据(stackoverflow.com/questions/13222468/android-google-analytics-connection-to-service-失败)。

这是我的analytics.xml:

 <?xml version="1.0" encoding="utf-8"?> <resources xmlns:tools="https://schemas.android.com/tools" tools:ignore="TypographyDashes"> <string name="ga_trackingId">UA-xxx-55</string> <bool name="ga_autoActivityTracking">true</bool> <bool name="ga_reportUncaughtExceptions">true</bool> <integer name="ga_dispatchPeriod">2</integer> <bool name="ga_debug">true</bool> </resources> 

而我的基本活动的一部分:

 public class BaseActivity extends ActionBarActivity { @Override public void onStart() { super.onStart(); EasyTracker.getInstance().activityStart(this); } @Override public void onStop() { super.onStop(); EasyTracker.getInstance().activityStop(this); } } 

问题是,为什么我的数据还没有显示在Google Analytics中? 我已经等了24-48小时,而且还是空的。

疑难解答相关的问题是:如果我直接从浏览器或Fiddler调用此URL:http://www.google-analytics.com/collect?v=1&ul=en-us&t=appview&sr=480×800&an=xxx&a=1825278197&tid = UA-xxx-55&aid = com.xxx.android&cid = 2b8c0c5de52ba05e&_u = .sB&av = 1.0&_v = ma1b3&cd = com.xxx.android.ProductActivity&qt = 2414&z = 141, (反应是一个1×1 gif图像。)如果是这样,那么这可能有助于将问题隔离到设置分析帐户。 (我使用这个帐户的许多其他网站和networking跟踪工作正常。)

编辑:这个版本的LogCat应该显示“HTTP响应代码:200”,因为这个post和上面链接的Blundell提到了,虽然看起来像EasyTracker的早期版本:www.asgarddesigns.com.au/2012/05 /的EasyTracker – 谷歌 – 分析集成换的Android /? 我没有,但我怀疑这可能是因为这个日志消息已从最新版本中删除。

Solutions Collecting From Web of "Google Analytics V2不logging来自Android应用的统计信息"

使用适用于Android和iOS的Google AnalyticsSDK版本2.0,您需要使用应用types 在GA中创build新的个人资料,以便查看正在收集和报告的数据。

这并没有真正突出显示,但是您可以在迁移指南中find它。

这意味着它将打破1.x版数据的历史,但数据收集和报告太混乱了,至less在beta阶段。