Quickstart-android: Disabling auto data collection issue

Created on 7 Nov 2017  ·  54Comments  ·  Source: firebase/quickstart-android

Hello, when I was testing the Firebase Analytics SDK, I saw some default events in Analytics dashboard (like "user_engagement", "first_open"). I searched the SDK about this and found

mFirebaseAnalytics = FirebaseAnalytics.getInstance(App.context());
mFirebaseAnalytics.setAnalyticsCollectionEnabled(false);

which is disabling auto colletion feature (also mentioned here). But whenever I use that method, I'm getting this message in logs Event not sent since app measurement is disabled and no data on Firebase Analytic Dashboard.

So is there any way to disable this auto collection feature without disabling the manual event sending feature ?

Thanks in advance

  • compileSdkVersion 26
  • buildToolsVersion "26.0.2"
  • minSdkVersion 16
  • targetSdkVersion 26
  • Google Play Services version: 11.7.45 (470-174122868)
classpath 'com.google.gms:google-services:3.1.1'
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-database:11.6.0'
analytics internal-bug-filed feature request

Most helpful comment

I do believe that Firebase Analytics should expose a setting to allow devs choosing to auto collect data or not. In some scenarios it is irrelevant to track activities, for example (they can be running non-UI tasks or just hosting fragments).

TL;DR +1 to reopen the issue.

All 54 comments

@OnurVar as far as I know you can either disable analytics completely (as you found) or enable it, which causes those automatic events to be fired.

You can find a list of those events here:
https://support.google.com/firebase/answer/6317485?hl=en

Can you explain a little more about why you want to disable these events if you are using Analytic?

@samtstern Thanks for the reply.

We have no intention to track these automatic events like "user_engagement". We only want to track some custom events which are being triggered on specific location of the app. We can successfully submit our track events to Firebase dashboard, but we are having some difficulties while we are looking at reports and filtering them out. But since this is the only way to track events, we will continue using the SDK with automatic event trigger feature enabled.

Thanks 👍

@OnurVar thanks for explaining! I will file this as a feature request anyway, maybe it's something we could enable you to turn off in the future.

I want to reopen this issue, because with the upcoming GDPA regulation in the EU everything related to users has to be treaded more carefully. It would be really nice to have a possibility to disable the automatic tracking and use firebase analytics just for in app events!

I do believe that Firebase Analytics should expose a setting to allow devs choosing to auto collect data or not. In some scenarios it is irrelevant to track activities, for example (they can be running non-UI tasks or just hosting fragments).

TL;DR +1 to reopen the issue.

Please allow us to disable those automatic events which are using data and cpu for things we might not want to track. I can see my app logging some automatic event for more than 5 minutes after refreshing data in my app!!!
Also with the GDPR we need to provide an exact list of the data stored so we NEED a way to control this. In the meantime, I'm disabling the firebase analytics

I haven't checked the library's latest version if they have this option to enable/disable it. We definitely need this option for GDPR.
Thanks

Is there an update on this? I could really use this right now...

I am implementing Firebase Analytics on iOS and I really don't want to track those automatic events.

It seems doesn't work on Android.

There is a FirebaseApp.dataCollectionDefaultEnabled, we can set it to false in application's meta-data. (I don't check, just baksmali the sdk).

<meta-data android:name="firebase_data_collection_default_enabled" android:value="false" />

There is no document for Android's SDK. However, it's documented in iOS's SDK.

https://firebase.google.com/docs/reference/swift/firebasecore/api/reference/Classes/FirebaseApp#/c:objc(cs)FIRApp(py)dataCollectionDefaultEnabled

Gets or sets whether automatic data collection is enabled for all products. Defaults to YES unless FirebaseDataCollectionDefaultEnabled is set to NO in your app’s Info.plist. This value is persisted across runs of the app so that it can be set once when users have consented to collection.

Could someone to check and verify this?

When I setted FirebaseDataCollectionDefaultEnabled to NO in my Info.plist, Firebase stopped collecting even my custom events. It's not an accepted solution!

Is there an update on this? Disabling auto-collected events is a core feature as I think, there are definitely should be a way to control what type of events we will be collecting

How will the calculator calculate without the 'user' itself.

On Mon, Oct 29, 2018, 1:23 AM Alexander Ageychenko notifications@github.com
wrote:

Is there an update on this? Disabling auto-collected events is a core
feature as I think, there are definitely should be a way to control what
type of events we will be collecting


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/firebase/quickstart-android/issues/370#issuecomment-433824344,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Alj2rM_eBSry-c60KOJJnz2M9_CNFtKQks5uprsYgaJpZM4QVi2Y
.

How will the calculator calculate without the 'user' itself.

I'm not talking about user itself, I'm talking about such events as:

  • app_exception
  • in_app_purchase
  • notification_receive
  • screen_view

They could be not relevant to some apps and all they do is just litter analytics logs

+1 This is really making me want to completely disable Firebase analytics, all I want is the basic custom event tracking (something Fabric was great at), not being able to turn this off after migrating sucks. Hard to believe this has been around since 2017...

Right now, our organisation is looking for alternatives to the Firebase Analytics for the following reasons:

  • No way to automatically disable analytics
  • The Android logging is setting architectural constraints - Why would 1 screen be coupled to 1 activity? Android 3.0 has been out for a while...

I see no reason why automatic tracking shouldn't be open for disabling. It makes for a weird argument on the side of Google/Firebase that we have no control on what data is sent. Not to mention the battery drain + unnecessary data traffic

+1
I have just finished testing custom events for bigquery export. The exported JSON file is filled with events I don't care, for more or less half the size of the file. And pricing is that we pay for storage size :-/. But more than anything we plan to have 100K users per day across several products, I wonder if we can stand wasting half of our machine resources when doing those ETL, it's a big constraint I discover here. Will see.
Coming from AWS world, I wonder if I should not find an alternative to Firebase (I'm only using it for tracking purpose).
Still no ETA since 2017, I'm not really surprised.

+1
How can I disable the auto collected log and just go with my custom event ?

Any news on this?
We don't want the screen_view events because we have an our custom implementation...
It's just useless data which makes noise and we also pay it on BigQuery export

+1
I need to disable tracking for certain activities, as they are only containers for one or more fragments. Right now, the activities show up in my analytics and I need them gone. PLEASE allow this. I've been trying to call setCurrentScreen(activity, null, null) but that doesn't do anything for me.

+1 for this "feature"

+1 for this feature

Same for me. It will be extremely useful to mask certain built-in events.

+1 for this feature. It would be great for one-activity applications.

Meanwhile at Google
Meanwhile at Google

+1 for this feature

+1 for this feature as well.

+1 for this as well.. the automatic collection is cluttering our analytics.
This also makes no sense when using a viewpager, the activity will get an extra screen_view event before the first fragment

+1 for this, hope there will be the possibility to disable automatic tracking soon.

+1 Being forced to track what Google wants me to track is ridiculous.

+1 I can disable automatic collection for iOS by putting a key to info.plist. FirebaseScreenReportingEnabled

Why doesn't Google let me do the same for Android? I tried to put the same key in Manifest.xml but no luck.

+1 - How can this be GDPR compliant?

+1 for this, really odd that it is offered on iOS but not on Android.

Is there a way to disable the "screen_view" alone from list of automatically collected events ?

@GeorgePeterPandian Yes, there is way to disable screen_view. The raw event of screen_view is implemented by registerActivityLifecycleCallbacks, so we can ignore the register of the callback.

    @Override
    public void registerActivityLifecycleCallbacks(ActivityLifecycleCallbacks callback) {
        // com.google.android.gms.measurement.internal.zzfj for firebase-core:16.0.9, play-services-measurement-impl:16.5.0
        if (!callback.getClass().getName().startsWith("com.google.android.gms.measurement.")) {
            super.registerActivityLifecycleCallbacks(callback);
        }
    }

Don't forget to keep names for it when shrink.

+1

+1, I really need to be able to disable automatic screen view collection

Without this features some clients want change library for other, or some custom solutions....

+1 for this feature, the feature should be aligned with the iOS SDK.

+1, We really need to be able to disable the automatic screen view collection. This results in a weird issue: screenview shown as not_set in Firebase console !!

+1

+1 Please, fix it, this is pretty annoying.

We are also facing the same issue in our project. Please fix this on priority.

Soon it is time for a 2 year anniversary on this issue and no response from the Firebase team.

It is kinda ironic how the feature is in the iOS SDK but not the Android one...

we drop firebase at this moment due to this privacy violation. now we move to flurry or appcenter -.-'

+1 for disabling screen_view and user_engagement.

Can we close this/mark this resolved? The obvious solution/fix is to de-google your project.

As entertaining as 2 years of email updates on this thread has been, it was a lot easier to just not include malware/spyware in my app.

Soon it is time for a 2 year anniversary on this issue and no response from the Firebase team.

It is kinda ironic how the feature is in the iOS SDK but not the Android one...

This. Priceless. Come on Google, you can do it (even I could, just give me the sources)

I think it is solved, https://firebase.google.com/docs/analytics/configure-data-collection?platform=android

I don't think so. That turns off all analytics..

This is not solved, and should be.

Despite explicitly disabling Firebase via AndroidManifest as well as programatically, I still see data collection happening in logcat.

FirebaseApp.getInstance().setDataCollectionDefaultEnabled(false); FirebaseAnalytics.getInstance(activity).setAnalyticsCollectionEnabled(false); FirebasePerformance.getInstance().setPerformanceCollectionEnabled(false);

<meta-data android:name="firebase_analytics_collection_enabled" android:value="false" />

<meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />

<meta-data android:name="google_analytics_ssaid_collection_enabled" android:value="false" />

Privacy laws are going to cause us all to leave Firebase if we can't fully disable it.

Update
Looking at Firebase DebugView, I noticed no events are being logged there with the above code (everything "disabled"). Once I re-enable things, debug view events start to show up. This might seem to indicate Firebase _is_ disabled, but I can't be sure based on the logcat entries.

There is currently no way to disable automated events in Analytics from being collected. This would be a good feature request for the SDK repos but is not a productive discussion in the quickstart, which has no bearing on API functionality.

Thanks Kato you're right, this thread has not remained useful. Thank you to everyone for the discussion to this point. When this issue was opened (2017) the Android SDK wasn't even open sourced yet so this might have been the best place at the time, but now we have a better venue for these requests.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rosariopfernandes picture rosariopfernandes  ·  6Comments

wellbranding picture wellbranding  ·  3Comments

shivamsriva31093 picture shivamsriva31093  ·  3Comments

naveenkumarn27 picture naveenkumarn27  ·  4Comments

fisache picture fisache  ·  4Comments