Firebase Analytics - How to add Screen Names and Log Events

前提是你 提交于 2019-12-11 14:13:10

问题


I want to add Screen Name and Log Event to Firebase's Analytics. I have tried below code, but I'm unable to see the Event & Screen Name in Firebase's Console.

//For Logging Event
Bundle bundle = new Bundle();
bundle.putString("custom_param",nameEditText.getText().toString());
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.GENERATE_LEAD, bundle);

//For Adding Screen Name
mFirebaseAnalytics.setCurrentScreen(this, "Visitor Entry", VisitorEntryActivity.class.getSimpleName());

I have already added Firebase SDK. I don't know what exactly settings I need to do. Thanks in advance.


回答1:


Under MyActivity.java put

protected void onResume() {
    isActivityLive = true;
    super.onResume();
    analytics.setCurrentScreen(this, "Screen Name", this.getClass().getSimpleName());
}


来源:https://stackoverflow.com/questions/50306635/firebase-analytics-how-to-add-screen-names-and-log-events

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!