4 ms·
Firebase client libraries silently import and enable Google Analytics in apps [0]. Then your app silently sends a lot of user behavior data to Google [1]. And
by mleonhard 5y ago
Firebase client libraries silently import and enable Google Analytics in apps [0]. Then your app silently sends a lot of user behavior data to Google [1].
Android apps which use push notifications must use the Firebase Cloud Messaging library. I think many app developers don't realize that adding that library also adds and enables analytics.
For example, adding the `firebase_messaging` module [2] to a Flutter app causes the Android build to import [3] the `com.google.firebase:firebase-bom` Java dep which includes `firebase-analytics` [4]. Once the Java library is included in the build, it starts working automatically [0].
To disable Google Analytics in an app:
* Firebase > Docs > Engage > Configure Analytics Data Collection and Usage [5]
* dart > firebase_analytics > FirebaseAnalytics > setAnalyticsCollectionEnabled method [6]
* Be sure to check the logs to make sure your change took effect. See "Firebase Google Group > Disabling analytics for iOS has no effect?" [7]
[0] https://support.google.com/analytics/answer/9353532 https://support.google.com/analytics/answer/9353532
[1] https://support.google.com/firebase/answer/9234069 https://support.google.com/firebase/answer/9234069
[2] https://pub.dev/packages/firebase_messaging https://pub.dev/packages/firebase_messaging
[3] https://github.com/FirebaseExtended/flutterfire/blob/a9562bac60ba927fb3664a47a7f7eaceb277dca6/packages/firebase_messaging/firebase_messaging/android/build.gradle#L52 https://github.com/FirebaseExtended/flutterfire/blob/a9562ba...
[4] https://mvnrepository.com/artifact/com.google.firebase/firebase-bom/29.0.3 https://mvnrepository.com/artifact/com.google.firebase/fireb...
[5] https://firebase.google.com/docs/analytics/configure-data-collection https://firebase.google.com/docs/analytics/configure-data-co...
[6] https://pub.dev/documentation/firebase_analytics/latest/firebase_analytics/FirebaseAnalytics/setAnalyticsCollectionEnabled.html https://pub.dev/documentation/firebase_analytics/latest/fire...
[7] https://groups.google.com/g/firebase-talk/c/rved9bIBT0g/m/YNUJ0B39BAAJ https://groups.google.com/g/firebase-talk/c/rved9bIBT0g/m/YN...