简体   繁体   English

Android版Google Analytics(分析)未发送匹配

[英]Google Analytics for Android not sending hits

I've tried everything. 我已经尝试了一切。 I triple-checked the dashes in the ID in analytics.xml, I have the two permissions needed, I have 我对analytics.xml中ID中的破折号进行了三重检查,我拥有所需的两个权限,

EasyTracker.getInstance().activityStart(this);
EasyTracker.getInstance().activityStop(this);

in the appropriate methods, and I still get the following in logcat: 在适当的方法中,我仍然在logcat中获得以下信息:

Thread[main,5,main]: Connection to service failed 1
Thread[main,5,main]: Need to call initialize() and be in fallbackmode to start dispatch.
Thread[GAThread,5,main]: No campaign data found.
Thread[GAThread,5,main]: putHit called
Thread[GAThread,5,main]: putHit called
Thread[Service Reconnect,5,main]: connecting to Analytics service
Thread[Service Reconnect,5,main]: connect: bindService returned false for Intent { act=com.google.android.gms.analytics.service.START (has extras) }
Thread[Service Reconnect,5,main]: Connection to service failed 1
Thread[GAThread,5,main]: Sending hit to store
Thread[GAThread,5,main]: Sending hit to store
Thread[GAThread,5,main]: dispatch running...
Thread[GAThread,5,main]: User-Agent: GoogleAnalytics/2.0 (Linux; U; Android 4.1.1; en-us; Galaxy Nexus Build/JRO03O)
Host: www.google-analytics.com
GET /collect?[information collected]
Thread[GAThread,5,main]: Exception sending hit: HttpHostConnectException
Thread[GAThread,5,main]: Connection to http://www.google-analytics.com refused
Thread[GAThread,5,main]: sent 0 of 40 hits

Then it repeats everything again starting at "dispatch running..." every 30 seconds, which is the interval I set. 然后,它每30秒重复一次从“调度运行...”开始的所有操作,这是我设置的间隔。

It isn't an internet problem, as my app connects to other websites just fine. 这不是互联网问题,因为我的应用可以很好地连接到其他网站。 The profile I have on the analytics website is for V2.0. 我在分析网站上拥有的个人资料适用于V2.0。 It's been well over two days since I set this up. 自从我进行设置以来已经过了两天了。

What else can I do? 我还可以做些什么?

I noticed an error that said 我注意到一个错误,说

Connection to www.google-analytics.com/127.0.0.1 refused 与www.google-analytics.com/127.0.0.1的连接被拒绝

and I thought "That's odd, why would it be going to the localhost?" 我以为“这很奇怪,为什么要去本地主机?” Then I remembered that I have a modified hosts file. 然后,我记得我有一个修改过的主机文件。 It looks like the hosts file I put on my phone to block ads also blocks google-analytics. 我放在手机上以阻止广告的主机文件似乎也阻止了google-analytics。 I've removed these entries and everything works fine. 我删除了这些条目,一切正常。 If you're having these troubles, check if your hosts file is blocking analytics. 如果遇到这些麻烦,请检查您的主机文件是否阻止了分析。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM