Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[firebase_analytics]: Crashlytics doesn't track screen view breadcrumbs #12760

Open
1 task done
TatsuUkraine opened this issue May 9, 2024 · 10 comments
Open
1 task done
Assignees
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: android Issues / PRs which are specifically for Android. platform: ios Issues / PRs which are specifically for iOS. plugin: crashlytics Stale Issue with no recent activity type: bug Something isn't working

Comments

@TatsuUkraine
Copy link
Contributor

TatsuUkraine commented May 9, 2024

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Analytics, Crashlytics

Which platforms are affected?

Android, iOS (not sure about iOS since some reports containing breadcrumbs)

Description

It seems logScreenView method doesn't track navigation changes. In the crashlytics reports breadcrumbs tab is empty

Reproducing the issue

FirebaseAnalytics.instance.logScreenView(screenName: 'some_screen_name');
FirebaseCrashlytics.instance.recordError('Some message', null);

Firebase Core version

2.29.0

Flutter Version

3.19.6

Relevant Log Output

No response

Flutter dependencies

Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.

Additional context and comments

It seems Dart plugin uses following code to log screen views

_delegate.logEvent(
      name: 'screen_view',
      parameters: filterOutNulls(<String, Object?>{
        _SCREEN_CLASS: screenClass,
        _SCREEN_NAME: screenName,
        if (parameters != null) ...parameters,
      }),
      callOptions: callOptions,
    );

Where _SCREEN_CLASS is screen_class and _SCREEN_NAME is screen_name

While according to the documentation it should be

await FirebaseAnalytics.instance.logEvent(
  name: 'screen_view',
  parameters: {
    'firebase_screen': screenName,
    'firebase_screen_class': screenClass,
  },
);

Firebase doc - https://firebase.google.com/docs/analytics/screenviews?authuser=0&hl=en#manually_track_screens
GA4 doc - https://support.google.com/analytics/answer/9234069#screen_view

Which kind of strange, since native SDK docs say that the current code in logScreenView is accurate 🤔

@TatsuUkraine TatsuUkraine added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels May 9, 2024
@TarekkMA TarekkMA added plugin: crashlytics platform: android Issues / PRs which are specifically for Android. platform: ios Issues / PRs which are specifically for iOS. labels May 9, 2024
@TarekkMA
Copy link
Contributor

TarekkMA commented May 9, 2024

Hello @TatsuUkraine, Thank you for reporting this issue. Can you please try and see if the following code would work?

await FirebaseAnalytics.instance.logEvent(
  name: 'screen_view',
  parameters: {
    'firebase_screen': screenName,
    'firebase_screen_class': screenClass,
  },
);

@TarekkMA TarekkMA added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels May 9, 2024
@TatsuUkraine
Copy link
Contributor Author

TatsuUkraine commented May 10, 2024

@TarekkMA it seems it's not, I'm getting following message on Android
E/FA (31087): Name starts with reserved prefix. Type, name: event param, firebase_screen

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels May 10, 2024
@TarekkMA
Copy link
Contributor

I guess firebase_screen and firebase_screen_class is for web only. Since the value of the AnalyticsParameterScreenName in swift and FirebaseAnalytics.Param.SCREEN_NAME for java/kotlin doesn't have the firebase prefix.

@TatsuUkraine
Copy link
Contributor Author

maybe, but it's quite confusing, since GA4 says it's for app, and Firebase docs having exact this codesnipet for Flutter

@TatsuUkraine
Copy link
Contributor Author

Снимок экрана 2024-05-10 в 11 50 29

@TatsuUkraine
Copy link
Contributor Author

still trying to test it on iOS to understand if it's Android only

@TatsuUkraine
Copy link
Contributor Author

TatsuUkraine commented May 10, 2024

ok, so it seems the issue is with com.google.gms.google-services.
GA doesn't work when app uses google-services v4.4.x, I see message like Missing google_app_id. in console.

Downgrading it to 4.3.x seems fixes GA reports as well as breadcrumbs in Crashlytics

P.S still trying to confirm that breadcrumbs working on iOS though

@TatsuUkraine
Copy link
Contributor Author

so on iOS this code send screen view events, but doesn't record screen name

await FirebaseAnalytics.instance.logEvent(
  name: 'screen_view',
  parameters: {
    'firebase_screen': screenName,
    'firebase_screen_class': screenClass,
  },
);

but logScreenView seems works fine in my debug code 🤔 need more time to track our prod logs to understand if works stable enough, since for now I see that not all of our error events having breadcrumbs from some reason

@TarekkMA TarekkMA self-assigned this May 10, 2024
@TarekkMA
Copy link
Contributor

Thank you for the update

@google-oss-bot
Copy link

Hey @TatsuUkraine. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: android Issues / PRs which are specifically for Android. platform: ios Issues / PRs which are specifically for iOS. plugin: crashlytics Stale Issue with no recent activity type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants