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 stops sending analytics
  • Cancels any scheduled analytics background work
  • Purges any unsent events from its local queue

This is not an Android 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.

Requirements

  • SDK initialized: Sees360.initialize(context, apiKey, identifier)
  • Permission: <uses-permission android:name="android.permission.INTERNET"/>
  • (Optional) Your own privacy UI (toggle + policy link)

How it works

Your app:

  1. Collects the user’s analytics consent (e.g. a switch in Settings).
  2. Persists the choice (e.g. DataStore or SharedPreferences).
  3. Applies the choice to the SDK:
    • Sees360.sharedInstance().setAnalyticsConsent(true) — analytics enabled
    • Sees360.sharedInstance().setAnalyticsConsent(false) — analytics disabled

On process start, reapply the previously saved choice after you initialize the SDK.

When enabled, the SDK:

  • Immediately accepts new events
  • Flushes queued events when thresholds are met
  • Schedules periodic uploads (every 6 hours by default) as a safety net

When disabled, the SDK:

  • Cancels any analytics jobs
  • Purges all unsent events
  • Rejects any new analytics submissions

Best practices

  • Default off. Don’t enable until the user explicitly opts in.
  • Persist and reapply consent at app start so the SDK always aligns with the last choice.
  • Keep it separate. Analytics consent is unrelated to any other Android permissions (e.g., Usage Access).

Troubleshooting

  • Toggle doesn’t change behavior: Ensure you call Sees360.sharedInstance().setAnalyticsConsent(checked) when the user flips the switch, and reapply the saved value after initialization.
  • Events still send after opt-out: Verify that you persist "denied" and actually call setAnalyticsConsent(false). Also check that your build includes the updated SDK with queue purge logic.

API reference

  • Sees360.sharedInstance().setAnalyticsConsent(granted: Boolean) — Enables/disables analytics instantly. On disable, cancels jobs and purges pending events.
  • Sees360.sharedInstance().isAnalyticsEnabled(): Boolean — Returns the current analytics state (useful for UI).

This consent setting also governs the track calls described in Event Tracking.


This site uses Just the Docs, a documentation theme for Jekyll.