Product Benefits Pricing Guides Docs About Contact us Try it out
Analytics tools

PostHog Android Opt-Out Pause: Consent Tracking

PostHog Android 3.72.7 pauses replay and autocapture on opt-out and restarts them on optIn(). Learn consent tracking steps to verify it.

· 3 min read

Opting out should mean opting out of everything. On Android, that has not always been true of every integration. PostHog’s Android SDK 3.72.7, released on 22 October, stops session replay, autocapture and other integrations while a user is opted out, and restarts them when optIn() is called.

If you do not track this, you cannot prove what your app did after a user said no. Teams also misread their numbers: after an upgrade, opted-out users go quiet, and an engagement dip may be a consent effect rather than a product problem.

The release notes add a detail worth testing. Replay restarts in a new session only if your app wanted it on at the moment of opt-out and has not since called stopSessionReplay(). An explicit stop from your own code still wins.

Data Points to Track

  • consent_state: opted_in, opted_out or unknown
  • consent_changed_at: timestamp of each optIn() or optOut() call
  • sdk_version: the PostHog Android version in the build
  • autocapture_active: true or false after each consent change
  • replay_active: true or false after each consent change
  • replay_stopped_manually: whether stopSessionReplay() was called before opt-out
  • session_id_before: session identifier before opt-in
  • session_id_after: session identifier after opt-in
  • events_while_opted_out: count of events seen from opted-out users (should be zero)

Setup Steps

  1. Upgrade the PostHog Android SDK to 3.72.7 or later in a test build.
  2. List every consent entry point, including settings screens, onboarding and system-level prompts.
  3. Log a consent event with consent_state and consent_changed_at whenever the choice changes.
  4. Check autocapture and replay status straight after each change and record the results.
  5. Run four test paths: opt out, opt back in, opt out with replay already stopped, and opt in on a fresh install.
  6. Watch your event stream for any events arriving from users flagged as opted out.
  7. Compare recorded sessions with opt-in events over the first week after release.
  8. Share the findings with your privacy and support teams.

Actionable Insights

If events_while_opted_out stays at zero, your consent handling is working. A non-zero count points to a code path that bypasses the SDK, such as a second analytics tool or a background service.

If opt-in events are high but recorded sessions are low, replay may be stopped manually somewhere in your code. Check replay_stopped_manually before assuming a bug.

If engagement metrics drop after upgrading, split users by consent_state. A fall limited to opted-out users is a measurement change, not a drop in real usage. Report both views so product decisions rest on the right numbers.

A new session on opt-in also means session length and screens per session start fresh. Avoid stitching the old and new sessions together without a clear reason.

Common Pitfalls

Do not call optIn() on every launch. It is a user choice, not a startup step.

Do not assume other analytics tools in the app follow the same rules.

Do not test only on a clean install, because returning users take different paths.

Treat consent events as records you may need to show later. Store them, version them and review them each release. A clean timeline of choices, session identifiers and integration status gives you a quick and honest answer when someone asks what your app collected.