firebase-analytics icon indicating copy to clipboard operation
firebase-analytics copied to clipboard

CAPBridgeViewController screen name should not be recorded in analytics

Open nguyentk90 opened this issue 5 years ago • 2 comments

There is a screen CAPBridgeViewController which is recorded in Firebase Analytics. It should not be recorded to avoid confusion when we manually setScreenName (Login, Register...).

Screen Shot 2020-08-03 at 10 45 26

nguyentk90 avatar Aug 03 '20 03:08 nguyentk90

@nguyentk90 I guess you are manually tracking screens in your app. By default Firebase will track screens automatically, but does it even make sense in an Ionic + Capacitor because there are no native screens?

From the firebase docs:

Manually tracking screens is useful if your app does not use a separate UIViewController or Activity for each screen you may wish to track, such as in a game.

...and in apps that run in a webview, right? So I think we need to track screens manually instead of relying on the automatic tracking functionality. So disabling this and start tracking screens manually would be an option.

Here is how you can disable the setting (https://firebase.googleblog.com/2020/08/google-analytics-manual-screen-view.html):

Can I disable automatically collected screen_view events and only use manual logging? Yes. While you can use both together at the same time, you can disable automatic event collection for screen_view events if you’d like. On iOS, set FirebaseAutomaticScreenReportingEnabled to “NO” in your info.plist. On Android, set google_analytics_automatic_screen_reporting_enabled to “false” in your manifest.

Please let me know if this helps 👍

kevinboosten avatar Jul 26 '21 12:07 kevinboosten

The settings described in https://firebase.googleblog.com/2020/08/google-analytics-manual-screen-view.html do not work in version 1.0.1 of capacitor firebase analytics plugin: https://github.com/firebase/firebase-android-sdk/issues/2225

Schwankenson avatar Sep 29 '22 09:09 Schwankenson