谷歌Analytics(分析)V2不记录从Android应用程序统计 [英] Google Analytics V2 not recording stats from Android app

查看:376
本文介绍了谷歌Analytics(分析)V2不记录从Android应用程序统计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用EasyTracker从我已经照着所有的<一个所述的步骤的SDK为Android V2.0测试版3。 href="https://developers.google.com/analytics/devguides/collection/android/v2/">https://developers.google.com/analytics/devguides/collection/android/v2/,并确保有连字符,而不是连接在我的ga_trackingId参数值破折号。

I'm using EasyTracker from the SDK for Android V2.0 beta 3. I've followed all the steps described at https://developers.google.com/analytics/devguides/collection/android/v2/, and have ensured that there are hyphen characters and not en dashes in my ga_trackingId parameter value.

我已经尽我在模拟器的应用程序为Android 2.2及4.1.2,以及作为一个真正的设备上。下面是LogCat中输出(部分删节):

I've tried my app in emulators for both Android 2.2 and 4.1.2, as well as on a real device. Here is (partially redacted) output from 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.

我已经通过所有相关帖子上这样走了。

I've gone through all the relevant posts on SO.

根据该:<一href="http://blog.blundell-apps.com/google-analytics-common-problems-and-fixes/">http://blog.blundell-apps.com/google-analytics-common-problems-and-fixes/,事实上,我看到...没有派遣表示数据被发送。

According to this: http://blog.blundell-apps.com/google-analytics-common-problems-and-fixes/, the fact that I'm seeing "...nothing to dispatch" indicates that the data was sent.

我不关心连接到服务失败1的警告,因为它一直没有停止过被记录的数据为其他人分析(stackoverflow.com/questions/13222468/android-google-analytics-connection-to -service-失败)

I'm not concerned about the "Connection to service failed 1" warning, as it hasn't stopped analytics data being recorded for other people ( stackoverflow.com/questions/13222468/android-google-analytics-connection-to-service-failed ).

下面是我的analytics.xml:

Here's my 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>

和我的基地活动的一部分:

And part of my base activity:

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);
    }
}

现在的问题是,为什么我的数据仍然没有出现在谷歌Analytics(分析)?我已经等了必要的24-48小时,而且它仍然是空的。

The question is, why is my data still not showing up in Google Analytics? I've waited the requisite 24-48 hours, and it's still empty.

一个故障排除相关的问题是:如果我直接调用这个URL从浏览器或提琴手:HTTP:// www.google-analytics.com/collect?v=1&ul=en-us&t=appview&sr=480x800&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,应该命中记录? (回应是1x1的GIF图像。)如果是这样,那么这可能有助于找出问题来设置Analytics帐户的,不知何故。 (我使用此帐户为许多其他网站和网络跟踪工作正常。)

A trouble-shooting related question is: if I call this URL directly from the browser or from Fiddler: http:// www.google-analytics.com/collect?v=1&ul=en-us&t=appview&sr=480x800&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, should the hit be recorded? (The response is a 1x1 gif image.) If so, then that may help to isolate the problem to setup of the analytics account, somehow. (I'm using this account for many other websites and web tracking is working fine.)

编辑:如果logcat的这个版本显示HTTP响应code:200,因为这个职位和布伦德尔一个连接的上述暗示,尽管对什么似乎EasyTracker的早期版本:www.asgarddesigns.com .AU / 2012/05 / easytracker - 谷歌 - 分析集成换安卓/?矿井没有,但我怀疑这可能是因为此日志消息从最新的版本中删除。

Should LogCat for this version show "HTTP Response Code: 200", as this post and the Blundell one linked to above allude to, albeit for what seems an earlier version of EasyTracker: www.asgarddesigns.com.au/2012/05/easytracker-google-analytics-integration-for-android/? Mine doesn't, but I suspect it may be because this log message was removed from the latest version.

推荐答案

随着谷歌Analytics(分析)SDK为Android和iOS的2.0版本,需要为创建GA 新的配置文件使用<强>应用程序类型以能够看到正在收集和报告的数据。

With version 2.0 of the Google Analytics SDK for Android and iOS, you need to create a NEW profile in GA using the App type to be able to see data being collected and reported.

这是不是真的,但突出你会发现它在迁移指南描述例如。

This is not really highlighted but you'll find it described in the migration guide for example.

这意味着,这将打破自1.x的版本数据的历史,但数据的收集和报告差异太大混合在一起,至少当他们在测试阶段。

It means that it will break the history of your data from the 1.x version, but data collection and reports are too different to be mixed together, at least while they are in beta stage.

这篇关于谷歌Analytics(分析)V2不记录从Android应用程序统计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆