How to opt out from Facebook SDK event logging?
Asked Answered
I

3

27

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.

EDIT: 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?

Intend answered 12/10, 2016 at 8:47 Comment(0)
I
10

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"
        android:value="false"/>
<meta-data android:name="com.facebook.sdk.AdvertiserIDCollectionEnabled"
        android:value="false"/>
<meta-data android:name="com.facebook.sdk.AutoInitEnabled"
        android:value="false"/> <!--OPTIONAL-->

And at runtime to opt in call:

FacebookSdk.setAutoLogAppEventsEnabled(true)
FacebookSdk.setAdvertiserIDCollectionEnabled(true)
// OPTIONALLY the following line if AutoInitEnabled is set to false in manifest:
FacebookSdk.setAutoInitEnabled(true) // automatically calls FacebookSdk.fullyInitialize() under the hood

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.

Intend answered 21/5, 2019 at 6:20 Comment(1)
To obtain user consent beforeGracegraceful
R
9

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"
            android:value="false"/>
Regan answered 18/6, 2018 at 7:54 Comment(1)
Logging can be enabled again with FacebookSdk.setAutoLogAppEventsEnabled(true); after user provides his consent if needed.Unnamed
K
0

The opt-out they are talking about is described in the heading below: https://developers.facebook.com/docs/app-events/android#setlimiteventusage

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

Kerns answered 17/10, 2016 at 9:14 Comment(3)
I suppose, but does that means there is no way of disabling any tracking whatsoever? For example, Firebase offers the method setAnalyticsCollectionEnabled. Enforcing tracking without any opt-out option is illegal in many countries.Intend
Facebook does not seem to offer that. :( Your best shot is probably to dealing with activating and manual logging either via some log wrapper of your own or with some condition checking on each call to their SDK. If you activate the logging in Application.onCreate() the user's option to opt-in or -out will be activated on next full application launch.Kerns
"Facebook may continue to use the information for other purposes, including frequency capping, conversion events, estimating the number of unique users, security and fraud detection, and debugging."Dominion

© 2022 - 2024 — McMap. All rights reserved.