Consent management
All Viafoura analytics events are tracked by default. ViafouraSDK.setDataTrackingEnabled is the single switch that gates the analytics ingest pipeline, so pass your CMP's result into it. Call it with false to suspend tracking and true to grant (or restore) consent.
It's a plain in-memory flag, so it can be set before or after initialize(), and it is not persisted across app launches: re-apply the stored consent value on every launch.
import com.viafourasdk.src.ViafouraSDK;
// All events are tracked by default — no call is needed to opt in.
// Reflect the user's choice from your consent flow:
ViafouraSDK.setDataTrackingEnabled(hasUserConsented);
// Revoke at any time; no further analytics events are sent.
ViafouraSDK.setDataTrackingEnabled(false);
ViafouraSDK.setDataTrackingEnabled(hasUserConsented)On Android the advertising ID is not collected automatically, it is only attached to events if your app assigns it via ViafouraSDK.advertisingIdentifier. Clear it alongside revoking consent:
ViafouraSDK.setDataTrackingEnabled(false); ViafouraSDK.advertisingIdentifier = null;
Updated about 15 hours ago
Did this page help you?
