屏幕跟踪支持 - Firebase 9.8 [英] Screen tracking support - Firebase 9.8

查看:292
本文介绍了屏幕跟踪支持 - Firebase 9.8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 9.8更新我们的Firebase Android SDK发行说明,我们具有Android屏幕和活动的屏幕跟踪支持 ...文档说这个事件的工作原理是这样的:

  mFirebaseAnalytics.setCurrentScreen(活性,CLASS_NAME,class_override_name); 

在我的情况下,我不需要覆盖类名,我发送空值...但我在等待48小时,我的firebase分析控制台不显示有关此事件,任何想法的信息?

在此先感谢! 解决方案首先我有同样的问题:Firebase仪表板上的当前屏幕名称是我的事件在哪里?
我调用了方法 mFirebaseAnalytics.setCurrentScreen(this,MainActivity,null); 没有任何结果



感谢Benoit的评论,我意识到这个方法指示了自动附加到您发送的任何事件的隐式参数的值。
这意味着它不是独立的事件,它是一个参数,将坚持所有的事件,因为你设置它。



这将是有用的,如果你有改变屏幕在单个Activity内。例如,当您有一个托管活动的多个片段。你可以在 onResume()中的每一个片段中调用这个方法。如果你想使用不同的度量你的屏幕名称 - 显式激发一个新事件。

  Bundle params = new Bundle(); 
params.putString(FirebaseAnalytics.Param.ITEM_CATEGORY,screen);
params.putString(FirebaseAnalytics.Param.ITEM_NAME,MainActivity);
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM,params);


According Firebase Android SDK Release Notes with 9.8 update we have screen tracking support with android screens and activities... The documentation says that this event works like that:

mFirebaseAnalytics.setCurrentScreen(activity,class_name,class_override_name);

In my case, I don't need overrides class name and I send null value... But i'm waiting 48h and my firebase analytics console doesn't show info about this event, any ideas?

Thanks in advance!

解决方案

First I had the same question: where is my event with current screen name on the Firebase dashboard? I've called method mFirebaseAnalytics.setCurrentScreen(this, "MainActivity", null); with no result.

Thanks to the comment by Benoit I realized that this method indicates the value of implicit parameter that is automatically attached to any event you send. That means it's not independent event, it's a parameter that will stick to all your events since you set it.

This will be useful if you have changing screens within single Activity. For example when you have multiple fragments with one hosting Activity. And you call this method in each fragment in onResume().

If you want to have distinct metric with the name of your screen - fire explicitly a new event for that.

Bundle params = new Bundle(); 
params.putString(FirebaseAnalytics.Param.ITEM_CATEGORY, "screen");
params.putString(FirebaseAnalytics.Param.ITEM_NAME, "MainActivity");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, params);

这篇关于屏幕跟踪支持 - Firebase 9.8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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