Repository navigation
Capture PostHog web vitals again - #330
Merged
Merged
Conversation
capture_performance: false, added with the autocapture cleanup in 815de5e, also turned off web vitals: a boolean here overrides the project setting. Capture vitals only; network timing stays off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Nov 3, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Turns PostHog web vitals back on, so we can see real-user CLS, LCP, INP and FCP per page. It's one line in
src/lib/posthog-browser-config.ts:Why
capture_performance: falsewent in with the autocapture cleanup on 03-26 (815de5e). In posthog-js 1.257.2 a boolean there overrides the project setting, so vitals stopped even though they're still on in PostHog. Weekly$web_vitalsevents went from 20,900 (week of 03-09) to 9 (week of 04-20), and there have been 4 in the last 45 days.Autocapture and pageleave stay off. Network timing stays off too, as it is today.
Cost
web-vitals.js(about 4 KB compressed) after it starts. It isn't in our bundle.What the data will look like
$web_vitalsevents, so count each metric on its own.With #328
Draft #328 delays PostHog until the page is idle. It keeps using
browserPostHogConfigand doesn't touch this file, so the two shouldn't conflict. Visitors who leave before PostHog loads wouldn't report vitals. The two haven't been tested together.Testing
npx tsc --noEmit, ESLint on the changed file andnpx jest(76 tests) all pass, and CI is green.web-vitals.jsloads, the recorder script doesn't, and FCP, LCP, CLS and INP all arrived in PostHog for/and/puzzles. To get CLS I simulated hiding the page.🤖 Generated with Claude Code