Consent flows are where analytics data quietly goes wrong. A user declines tracking on day one, changes their mind on day nine, and your dashboards need to treat that second session as the start of a new story. PostHog’s iOS SDK 3.92.1, released on 21 October, changes what happens at that moment: session replay now starts in a new session when optIn() is called.
Without a clear view of this, teams make two mistakes. They assume replay resumed inside the old session, so recordings look short or broken. Or they assume nothing was recorded at all, and miss that a fresh session began on opt-in. Either way, your count of recorded sessions, and any funnel built on them, will not match what really happened.
One detail matters for privacy. According to the release notes, if your app called stopSessionRecording() before optOut(), replay stays stopped after the user opts back in. Your own explicit stop wins.
Data Points to Track
- consent_state: opted_in, opted_out or unknown
- consent_changed_at: timestamp of the optIn() or optOut() call
- session_id_before: the session identifier before the change
- session_id_after: the session identifier after optIn()
- replay_status: active, stopped or not started
- replay_stopped_manually: whether stopSessionRecording() was called first
- sdk_version: the PostHog iOS version in the build
- days_since_install: how long the user waited before opting in
Setup Steps
- Upgrade the PostHog iOS SDK to 3.92.1 or later in a test build.
- Map your consent screens and list every place that calls optIn() or optOut().
- Fire a custom event with consent_state and consent_changed_at each time the choice changes.
- Attach session_id_before and session_id_after to that event so the session split is visible.
- Record replay_status straight after optIn(), using the recording status your build exposes.
- Test three paths: a new user who opts in, a returning user who opts back in, and a user whose replay you stopped manually.
- Compare recorded sessions with opt-in events for a week after release.
- Document the behaviour for support and legal teams so everyone describes it the same way.
Actionable Insights
If recorded sessions match opt-ins closely, consent and replay are working together. Any gap points to a code path that skips optIn() or stops replay on purpose.
A large number of users who opt in late shows how much data your first-run prompt costs you. Test the wording, timing and placement of the prompt, and watch whether opt-in rates and early retention move together.
If replay_stopped_manually is common, check why. It may be a privacy screen you added deliberately, or a leftover from an old release that now blocks recordings you want.
Finally, remember that a new session on opt-in means session-based metrics, such as session length or screens per session, will start fresh for that user. Do not stitch the old and new sessions together unless you have a clear reason.
Common Pitfalls
Do not treat a missing recording as a bug before checking consent state.
Do not call optIn() on every launch. It is a user choice, not a startup step.
Do not forget web views or embedded flows that may have their own consent handling.
Keeping Consent Data Trustworthy
Treat the consent event as a first-class record. Store it, version it and review it each release. When regulators or customers ask what you collected and when, a clean timeline of consent changes, session identifiers and replay status gives you a fast, honest answer.