PostHog / posthog-js

Send usage data from your web app or site to PostHog, with autocapture.
https://posthog.com/docs/libraries/js
Other
278 stars 114 forks source link

chore: add page title to custom events #1410

Closed daibhin closed 2 weeks ago

daibhin commented 2 weeks ago

Changes

In working through some of the design changes proposed in https://github.com/PostHog/posthog/issues/24561 we are looking to track the title of a given page in the playback tabs

Screenshot 2024-09-10 at 20 26 01

Given we don't want to rely on $pageview events where possible in Replay because we can't always guarantee a customer uses events, it seems like the only alternative is to add the title to the custom rrweb events.

Open to pushback here. Other options include: 1) Never showing the title during playback and just relying on the url 2) Only enhancing the tab with the title if a customer collects events

Checklist

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Sep 10, 2024 7:26pm
github-actions[bot] commented 2 weeks ago

Size Change: +526 B (+0.04%)

Total Size: 1.19 MB

Filename Size Change
dist/array.full.js 341 kB +133 B (+0.04%)
dist/array.js 157 kB +131 B (+0.08%)
dist/main.js 158 kB +131 B (+0.08%)
dist/module.js 157 kB +131 B (+0.08%)
ℹ️ View Unchanged | Filename | Size | | :--- | :---: | | `dist/exception-autocapture.js` | 10.4 kB | | `dist/recorder-v2.js` | 110 kB | | `dist/recorder.js` | 111 kB | | `dist/surveys-preview.js` | 59.8 kB | | `dist/surveys.js` | 66 kB | | `dist/tracing-headers.js` | 8.26 kB | | `dist/web-vitals.js` | 10.3 kB |

compressed-size-action

pauldambra commented 2 weeks ago

I wonder if we could do this with a plugin on the replayer side... the full snapshots will have the doc title in and changes to the title will come through in mutations

(which has the benefit it would work on old recordings too)

daibhin commented 2 weeks ago

Closing in favour of https://github.com/PostHog/posthog/pull/24943