Skip to main content

I’m using AmplitudeSwift SDK to my iOS app. I have a toggle in the app to allow users to opt out the analytics. The SDK document states it should be as simple as setting optOut = true.

let amplitude = Amplitude(
    configuration: Configuration(
        apiKey: AMPLITUDE_API_KEY,
        optOut: true
    )
)

However, I implemented the constructer in my code to respect user preferences.

    private init() {
let analyticsEnabled = UserDefaults.standard.bool(forKey: "analyticsEnabled")
amplitude = Amplitude(configuration: Configuration(
apiKey: Constants.amplitudeKey,
optOut: !analyticsEnabled
))
}

It works that manual trackings are stopped, but I can still receive the anonymous session tracks on my dashboard. Is it expected? How can I entirely opt out the user in that case?
 

 

Be the first to reply!

Reply