Skip to main content
Question

Session still automatically tracked when `optOut == true`?


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?
 

 

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings