Analytics Consent (Opt-In / Opt-Out)
Give users explicit control over whether the SDK collects and sends analytics.
Overview
Sees360 respects user choice.
Analytics are off by default until your app explicitly opts in.
When the user opts out, the SDK:
- Immediately rejects any new analytics calls (
track(name:)and screen-view tracking all no-op rather than queue) - Purges any already-queued, not-yet-delivered events
This is not an iOS runtime permission — it’s a consent toggle exposed in your app (e.g. privacy settings or onboarding). Your app is responsible for collecting the user’s choice and passing it to the SDK.
This setting only affects analytics events. Core Sees360 reporting (platform/approximate location) and usage-stats are separate and are not affected by the analytics consent setting.
Requirements
- SDK initialized:
Sees360.initialize(apiKey: apiKey, identifier: identifier) - (Optional) Your own privacy UI (toggle + policy link)
- No extra permissions or
Info.plistentries, this is a pure runtime flag, not an OS-level permission
How it works
Your app:
- Collects the user’s analytics consent (e.g. a switch in Settings).
- Persists the choice (e.g.
UserDefaults, or wherever else you keep other privacy choices). -
Applies the choice to the SDK:
Sees360.sharedInstanceIfInitialized()?.setAnalyticsConsent(granted: true) // analytics enabled Sees360.sharedInstanceIfInitialized()?.setAnalyticsConsent(granted: false) // analytics disabled
When enabled:
- New
trackand screen-view calls are accepted and queued for delivery as normal.
When disabled:
- New calls are rejected immediately, nothing is added to the local queue.
- Anything already queued from before consent was revoked is purged from the local outbox in the background.
Best practices
- Default off. Don’t call
setAnalyticsConsent(granted: true)until the user explicitly opts in. - Persist and reapply consent at app start, right after
initialize, so the SDK always aligns with the last choice. - Keep it separate. Analytics consent is unrelated to any other iOS permission (e.g. Core Location authorization, which independently gates whether device-context events can include approximate location).
Troubleshooting
- Toggle doesn’t change behavior: Make sure you’re calling
setAnalyticsConsent(granted:)on the shared instance,Sees360.sharedInstanceIfInitialized()returnsnil(silently no-oping the call) if the SDK hasn’t finishedinitializeyet. - Events still send after opt-out: Confirm your app is actually persisting the “denied” choice and reapplying it on every launch, not just toggling it in-memory for the current session.
isAnalyticsEnabled()returnsfalseafter opting in: ConfirmsetAnalyticsConsent(granted: true)was actually called on the SDK.
API reference
Sees360.sharedInstanceIfInitialized()?.setAnalyticsConsent(granted: Bool)— Enables/disables analytics. Disabling also purges pending events from the local queue.Sees360.sharedInstanceIfInitialized()?.isAnalyticsEnabled() -> Bool- Returns the current analytics state (useful for reflecting it back in your own UI).
This consent setting also governs the calls described in Event Tracking, ad click tracking, and screen-view tracking (UIKit / SwiftUI).