android – How to opt out from Facebook SDK event logging?-ThrowExceptions

Exception or error:

I’m using Facebook App Events tracking for Android, but I have no idea how to disable tracking when a user wants to opt out! Does anyone know how to do that?

The documentation says:

We recommend that you use our SDK tools to offer the opt-out.

But they don’t actually describe it anywhere. Classic Facebook move.

Now with the GDPR being in effect for so long, they still don’t have any way to disable all tracking until the user consents, do they?

How to solve:

Don’t know about per User, but you can opt put from Facebook SDK event logging:

Add this int your Android.Manifest.xml:

<meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled"


After the documentation was updated it seems the new way to go is a combination of disabling

<meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled"
<meta-data android:name="com.facebook.sdk.AdvertiserIDCollectionEnabled"
<meta-data android:name="com.facebook.sdk.AutoInitEnabled"
        android:value="false"/> <!--OPTIONAL-->

And at runtime to opt in call:

// OPTIONALLY the following two lines if AutoInitEnabled is set to false in manifest:

Right now I don’t see when it would be good to disable (and later enable) auto init, maybe someone else might have an idea here.


The opt-out they are talking about is described in the heading below:

You can call AppEventsLogger.setLimitEventUsage(this, true); to “opt-out” (at least limit) how the events logged are used.

Leave a Reply

Your email address will not be published. Required fields are marked *