问题
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