Android - 已发送Google Analytics(分析)V4事件,但未显示 [英] Android - Google Analytics V4 event sent but not shown

查看:449
本文介绍了Android - 已发送Google Analytics(分析)V4事件,但未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将Google AnalyticsSDK V4集成到我的应用中,但发送事件时遇到问题。
我整合了SDK并生成了配置文件,如。我在我的项目中集成了conf文件,设置了我的build.gradle文件,将AnalyticsService添加到了我的Manifest中,并在我的应用程序类中初始化Google Analytics:

  synchronized public Tracker getDefaultTracker(){
if(mTracker == null){
GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
mTracker = analytics.newTracker(R.xml.global_tracker);
}
返回mTracker;
}

R.xml.global_tracker在构建时生成,只包含字符串ga_trackingId 。



当我尝试发送事件时,我可以在logcat上看到它们发送的内容:

  09-19 11:04:29.167 com.myapp.mypackage.debug I / GAv4:Google Analytics 9.0.80正在启动。要在设备上运行调试日志记录:
adb shell setprop log.tag.GAv4 DEBUG
adb logcat -s GAv4
09-19 11:04:29.207 com.myapp.mypackage.debug W / GAv4:AnalyticsReceiver未注册或已禁用。注册接收器,以便在非Google Play设备上进行可靠的调度。请参阅url获取说明。
09-19 11:04:29.227 com.myapp.mypackage.debug W / GAv4:CampaignTrackingReceiver未注册,未导出或已禁用。安装活动跟踪是不可能的。请参阅url获取说明。
09-19 11:04:29.737 com.myapp.mypackage.debug D / GAv4:发送第一个命中属性:UA-XXXXXXXX-2
09-19 11:04:29.737 com.myapp。 mypackage.debug D / GAv4:命中交付请求:ht = 1474275869721,_s = 0,_v = ma9.0.80,a = 1185092937,aid = com.myapp.mypackage.debug,an = MyApp,av = 1.7-DEBUG,cd = Search,cid = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,sr = 800x1280,t = screenview,tid = UA-XXXXXXXX-2,ul = fr-fr,v = 1
09-19 11:04:30.148 com.myapp.mypackage。调试D / GAv4:命中发送到设备AnalyticsService交付
09-19 11:05:49.235 com.myapp.mypackage.debug D / GAv4:命中交付请求:ht = 1474275949229,_s = 1,_v = ma9.0.80,a = 1185092938,aid = com.myapp.mypackage.debug,an = MyApp,av = 1.7-DEBUG,cd = Search,cid = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,ea = CustomerAccount,ec = Search,sr = 800x1280,t =事件,tid = UA-XXXXXXXX-2,ul = fr-fr,v = 1
09-19 11:05:49.425 com.myapp.mypackage.debug D / GAv4:点击发送到设备AnalyticsService
09-19 11:05:49.435 com.myapp.mypackage.deb ug D / GAv4:命中交付请求:ht = 1474275949372,_s = 2,_v = ma9.0.80,a = 1185092938,aid = com.myapp.mypackage.debug,an = MyApp,av = 1.7-DEBUG,cd = UserAccount .LoggedOut,cid = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,sr = 800x1280,t = screenview,tid = UA-XXXXXXXX-2,ul = fr-fr,v = 1
09-19 11:05:49.455 com.myapp.mypackage。调试D / GAv4:Hit发送到设备AnalyticsService以交付

但我从未在开发人员身上看到它们安慰。当我在控制台上使用Analytics API时,我看到在此时间范围内没有此API的数据。我在星期五和48小时之后做了我的测试,并没有出现。
此外,我在Analytics API控制台上看到此警告:


此API已启用,但您无法使用它在你的项目中,直到你
创建凭证。点击Go to Credentials来执行此操作
(强烈推荐)。转到凭证概览配额


如果我转到凭证概览,可以看到Android键(由Google Service自动创建),它对应于我的google-services.json中的键,所以我不明白为什么警告在这里。



你能看到问题来自哪里?



谢谢!

解决方案

显然,我并没有看好这个好地方。我认为分析报告可以在开发者控制台上的Analytics API中看到,但是由于ZShock,我知道他们在分析。 google.com 。它不会写在官方文档的任何地方,所以它对于新用户来说是相当令人不安的。

I want to integrate Google Analytics SDK V4 in my app but I have a problem sending events. I integrated the SDK and generated the configuration file as indicated on the offical documentation. I integrated the conf file on my project, set my build.gradle file, added the AnalyticsService to my Manifest and initialized Google Analytics in my application class:

synchronized public Tracker getDefaultTracker() {
    if (mTracker == null) {
        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        mTracker = analytics.newTracker(R.xml.global_tracker);
    }
    return mTracker;
}

The R.xml.global_tracker is generated at build and only contains the string ga_trackingId.

When I try to sent events, I can see on the logcat they are sent:

09-19 11:04:29.167 com.myapp.mypackage.debug I/GAv4: Google Analytics 9.0.80 is starting up. To enable debug logging on a device run:
                                                          adb shell setprop log.tag.GAv4 DEBUG
                                                          adb logcat -s GAv4
09-19 11:04:29.207 com.myapp.mypackage.debug W/GAv4: AnalyticsReceiver is not registered or is disabled. Register the receiver for reliable dispatching on non-Google Play devices. See url for instructions.
09-19 11:04:29.227 com.myapp.mypackage.debug W/GAv4: CampaignTrackingReceiver is not registered, not exported or is disabled. Installation campaign tracking is not possible. See url for instructions.
09-19 11:04:29.737 com.myapp.mypackage.debug D/GAv4: Sending first hit to property: UA-XXXXXXXX-2
09-19 11:04:29.737 com.myapp.mypackage.debug D/GAv4: Hit delivery requested: ht=1474275869721, _s=0, _v=ma9.0.80, a=1185092937, aid=com.myapp.mypackage.debug, an=MyApp, av=1.7-DEBUG, cd=Search, cid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, sr=800x1280, t=screenview, tid=UA-XXXXXXXX-2, ul=fr-fr, v=1
09-19 11:04:30.148 com.myapp.mypackage.debug D/GAv4: Hit sent to the device AnalyticsService for delivery
09-19 11:05:49.235 com.myapp.mypackage.debug D/GAv4: Hit delivery requested: ht=1474275949229, _s=1, _v=ma9.0.80, a=1185092938, aid=com.myapp.mypackage.debug, an=MyApp, av=1.7-DEBUG, cd=Search, cid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, ea=CustomerAccount, ec=Search, sr=800x1280, t=event, tid=UA-XXXXXXXX-2, ul=fr-fr, v=1
09-19 11:05:49.425 com.myapp.mypackage.debug D/GAv4: Hit sent to the device AnalyticsService for delivery
09-19 11:05:49.435 com.myapp.mypackage.debug D/GAv4: Hit delivery requested: ht=1474275949372, _s=2, _v=ma9.0.80, a=1185092938, aid=com.myapp.mypackage.debug, an=MyApp, av=1.7-DEBUG, cd=UserAccount.LoggedOut, cid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, sr=800x1280, t=screenview, tid=UA-XXXXXXXX-2, ul=fr-fr, v=1
09-19 11:05:49.455 com.myapp.mypackage.debug D/GAv4: Hit sent to the device AnalyticsService for delivery

But I never see them on the Developer console. When I go on Analytics API on my console, I see "There is no data for this API in this time span". I did my tests friday and event after more than 48h, they don't appear. Also, I see this warning on the Analytics API console:

This API is enabled, but you can't use it in your project until you create credentials. Click "Go to Credentials" to do this now (strongly recommended). Go to Credentials Overview Quotas

If I go to the Credentials Overview, I can see the key "Android key (auto created by Google Service)" which correspond to the key in my google-services.json, so I don't understand why the warning is here.

Can you see where the problem comes from? I searched a lot but was enable to find a response to it.

Thanks!

解决方案

So apparently, I wasn't looking at the good place. I thought the analytics reports could be seen on the dev console, in Analytics API, but thanks to ZShock, I know they are on analytics.google.com. It isn't written anywhere on the official documentation, so it's pretty disturbing for new users...

这篇关于Android - 已发送Google Analytics(分析)V4事件,但未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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