Skip to content

feat(Analytics): Focus session replays on new users - #9233

Draft
talissoncosta wants to merge 3 commits into
mainfrom
feat/session-replay-new-users
Draft

talissoncosta wants to merge 3 commits into
mainfrom
feat/session-replay-new-users

Conversation

@talissoncosta

@talissoncosta talissoncosta commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Our Amplitude replay quota runs out around the 20th of each month: nothing was recorded from 20 to 30 Nov. Replays currently sample 50% of every session, so long sessions from established users use the quota we want for new ones.

  • Record replays only for sessions that matter for activation:
    • logged out on the way in (/, /signup, /login, /oauth/*, /saml, /activate/*)
    • logged in, during a user's first 7 days (date_joined), on every page, including projects
    • established users: nothing
  • The replay plugin is added only when a session first qualifies, then paused and resumed on route change, login and logout. A returning user's boot redirect to /?redirect= is not treated as a way in.
  • Track rage and dead clicks (frustrationInteractions) so replays can be filtered by frustration.
  • debugMode outside production to log replay start and stop.

How did you test this code?

  • Unit tests for shouldRecordReplay and the start/stop controller (npm run test:unit -- --testPathPatterns=sessionReplay).
  • Not yet verified in a browser: no local env has an Amplitude key. To check on a build with a key, with the console open:
    1. Sign up a new user: replay starts and stays on through onboarding and the project pages.
    2. Log in as a user who joined more than 7 days ago: replay stops after login, and reloading a project page doesn't start it.

Record replays from signup and login through a user's first 7 days,
including project pages, and nothing for established users. Track
rage/dead clicks and an Onboarding skipped event to filter replays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
flagsmith-frontend-preview Ready Ready Preview Dec 3, 2026 7:32pm UTC
flagsmith-frontend-staging Ready Ready Preview Dec 3, 2026 7:32pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Dec 3, 2026 7:32pm UTC

Request Review

This branch was successfully deployed

2 active deployments
Preview – flagsmith-frontend-preview — 4787e6e6 Deployed Dec 3, 2026 by vercel[bot]
Preview – flagsmith-frontend-staging — 4787e6e6 Deployed Dec 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant