flutterfire
flutterfire copied to clipboard
[firebase_analytics]: Crashlytics doesn't track screen view breadcrumbs
Is there an existing issue for this?
- [X] 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 🤔
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 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
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.
maybe, but it's quite confusing, since GA4 says it's for app, and Firebase docs having exact this codesnipet for Flutter
still trying to test it on iOS to understand if it's Android only
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
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
Thank you for the update
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!
small update. After downgrading google-services version android breadcrumbs it seems reported. Strange thing though that for iOS not every report contains breadcrumbs. The majority of them do, but not all of them. And for now I don't know the reason why
@TatsuUkraine Hello, can you try to update Flutter and FlutterFire, then try again to see if the issue still happens?
@TarekkMA hello, we did the release 2 weeks ago with most up to date versions at that time, and I still see that some reports from iOS devices don't have Breadscrumbs, not a lot, and I still haven't figure the reason
@TatsuUkraine I don't think this issue is related to the Flutter side of FlutterFire. It might be related to the native iOS SDK (https://github.com/firebase/firebase-ios-sdk) or the server side. Could you try contacting Firebase support regarding this issue?