1

I am using the following block of code to track screens and user events in my application, but screen name.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    setContentView(R.layout.activity_corporate);

    FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
    Bundle params = new Bundle();
    params.putString(FirebaseAnalytics.Param.ITEM_NAME, "Corporate Screen - Android");
    mFirebaseAnalytics.setCurrentScreen(this, "Corporate Screen Android", null);
    mFirebaseAnalytics.logEvent("Corporate_Screen_Android", params);

    initViews();
}

Firebase Console

Kanwarpreet Singh
  • 2,037
  • 1
  • 13
  • 28
  • Duplicate (with solution): https://stackoverflow.com/questions/50952080/firebase-screen-name-is-showing-not-set/ – Vesper Nov 04 '19 at 15:51
  • 1
    @Vesper There is nothing as such mention in the firebase documentation of Firebase Analytics, So why I need to declare it into the onResume method. – Kanwarpreet Singh Nov 07 '19 at 05:36
  • I have set Screen Name in OnResume() itself, still the Firebase shows me NOT_SET with some percentage? Is there any other reason to categorize as NOT_SET? – shakunthalaMK Jun 24 '20 at 12:05

1 Answers1

1

place the following code:

mFirebaseAnalytics.setCurrentScreen(this, "Screen Name", null);

in onResume() method of Activity.

Kanwarpreet Singh
  • 2,037
  • 1
  • 13
  • 28