Session replay and surveys
Turn on PostHog session replay with every input and every line of text masked, keep it off the pages that hold credentials or billing, and ask stalled users what stopped them with PostHog Surveys.
PostHog's own session replay and surveys, each behind one flag under config.analytics.posthog. Both ship off; with PostHog not configured, neither exists.
analytics: {
posthog: {
publicKey: "phc_...",
host: "https://us.i.posthog.com",
sessionReplay: true, // default false
surveys: true // default false
}
}Session replay
posthog.init always starts with recording disabled, whatever the project's remote settings say. With sessionReplay: true the masking below is passed to the SDK and <SessionReplayController> starts and stops the recorder page by page (apps/web/lib/analytics/session-replay.ts).
| Masked or blocked | How |
|---|---|
| Every input value | maskAllInputs: true |
| Every text node | maskTextSelector: "*" |
| Images, video, canvas | blockSelector, recorded as placeholders |
| Network headers and bodies | recordHeaders: false, recordBody: false |
| Never recorded | Rule |
|---|---|
| Sign-in and sign-up | the section of config.routes.auth |
| Settings, billing among them | the sections of config.routes.settings and config.routes.settingsBilling |
| Admin | the section of config.routes.admin |
| Checkout and link pages | /checkout, /delete-account, /accept-invitation, /unsubscribe |
| A token in the address | any URL urlCarriesCredential flags |
| A visitor without consent | PostHog waits for the cookie banner |
| An opted-out account | users.analyticsOptOut (opt-out), and while the session is still loading |
| Local builds and the e2e harness | a page served from loopback never starts PostHog |
Masking shows where people clicked and how the layout responded, never what they read or typed. Still list replay in your privacy policy, and set the retention you want under PostHog → Session replay → Settings.
Surveys
surveys: false passes disable_surveys: true, so the SDK never fetches survey definitions. With surveys: true PostHog shows the surveys you create and target in its UI; no code is needed.
In PostHog, Surveys → New survey, type Popover, one open text or single choice question: "What stopped you from finishing?".
Display conditions → User sends events: pick a wall or stall from Product signals - limit_reached, paywall_viewed, form_error or error_shown. Add a property filter such as surface = chat to aim it at one screen.
Set Survey wait period (for example 14 days) so a person is asked once, then launch. Responses arrive as survey sent events tied to the same person, beside the events that triggered them.
A survey's free-text answer is content the person chose to send you. It lives in PostHog only, never in your database, and a visitor who declined consent is never shown a survey.
Product signals
The built-in events that show where users get stuck, hit a limit, reach first value or leave - fired centrally from the shared form, toaster, empty state and billing screens, with ids only and never what anyone typed.
Pageviews and attribution
PostHog capture settings (SPA pageviews, page-leaves, dead clicks, web vitals) and first-touch attribution - the first_touch cookie, the user field it lands on, and the person properties it feeds.