Firebase Analytics Events - currentScreen is always screen_view
Asked Answered
A

2

5

On my way implementing firebase analytics into my flutter app, i cant get the proper events to trigger or i dont get how this should work. Lets take the following code:

firebaseAnalytics.setCurrentScreen(screenName: "Dashboard");

When i trigger this event, in the Firebase Analytics debug view i see this:

Firebase Analytics DebugView

The same when i trigger the screen changes automatically via:

navigatorObservers: [
        FirebaseAnalyticsObserver(analytics: appState.firebaseAnalytics),
      ],

So my question is: Why does Analytics prints out "screen_view" instead of "Dashboard" or any other name i have in my named routes ??

The screen name is in fact submitted to the inner workings of the API cause i debugged firebase_analytics.dart on that place:

Future<void> setCurrentScreen(
      {@required String screenName,
      String screenClassOverride = 'Flutter'}) async {
    if (screenName == null) {
      throw ArgumentError.notNull('screenName');
    }

    await _channel.invokeMethod<void>('setCurrentScreen', <String, String>{
      'screenName': screenName,
      'screenClassOverride': screenClassOverride,
    });
  }
Azilian answered 9/10, 2019 at 19:30 Comment(0)
A
9

Answering my own question and thus wasting the bounty is hard but thats the way it is. Here are my findings:

The user provided screenName in the API gets submitted to the Firebase Analytics Dashboard but you need to drill down on the event "screen_view" to see the actual clicked screen Names you supplied. Unfortunately the user supplied Name wont be shown in the debugView of the Firebase Analytics console which got me on the wrong trail in the first place, thinking that its missing altogether, which is wrong.

tl;dr: screenName is just a parameter of screen_view Event and its right inside the screen_view event which you can drill down on.

Azilian answered 13/10, 2019 at 21:32 Comment(0)
D
0

Why route names don't show in the DebugView by using navigatorObservers? Looking for an explanation to this issue I got here and found the answer in Marc's Answer. It is actually being collected and is located as a parameter called firebase_screen.🧐

Dibucaine answered 19/11, 2020 at 4:8 Comment(1)
Please don't add "thanks" as answers. They don't actually provide an answer to the question, and can be perceived as noise by its future visitors. Instead, upvote answers you like. This way future visitors of the question will see a higher vote count on that answer, and the answerer will also be rewarded with reputation points. See Why is voting important.Euripides

© 2022 - 2025 — McMap. All rights reserved.