Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Screen dimensions and UA as person property #1840

Merged
merged 2 commits into from
Mar 20, 2025

Conversation

robbie-c
Copy link
Member

@robbie-c robbie-c commented Mar 20, 2025

Changes

Add screen / viewport dimensions as a person property
Also adds raw_user_agent

Needed to support some conversion destinations

Checklist

  • Tests for new code (see advice on the tests we use)
  • Accounted for the impact of any changes across different browsers
  • Accounted for backwards compatibility of any changes (no breaking changes in posthog-js!)

Copy link

vercel bot commented Mar 20, 2025

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

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Mar 20, 2025 3:03pm

@robbie-c robbie-c requested a review from MarconLP March 20, 2025 14:47
@robbie-c robbie-c added the bump patch Bump patch version when this PR gets merged label Mar 20, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Added screen dimensions, viewport dimensions, and user agent string as person properties in the PostHog JavaScript SDK for enhanced user tracking capabilities.

  • Added $screen_height, $screen_width, $viewport_height, $viewport_width to EVENT_TO_PERSON_PROPERTIES array in /src/utils/event-utils.ts
  • Added $raw_user_agent property with 1000 character limit truncation in Info.properties()
  • Integrated new properties into existing person property collection flow
  • Properties are automatically captured and included in all relevant event tracking

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link

github-actions bot commented Mar 20, 2025

Size Change: +88 B (0%)

Total Size: 3.6 MB

Filename Size Change
dist/customizations.full.js 14.1 kB +88 B (+0.63%)
ℹ️ View Unchanged
Filename Size
dist/all-external-dependencies.js 220 kB
dist/array.full.es5.js 278 kB
dist/array.full.js 381 kB
dist/array.full.no-external.js 380 kB
dist/array.js 188 kB
dist/array.no-external.js 187 kB
dist/dead-clicks-autocapture.js 14.5 kB
dist/exception-autocapture.js 9.94 kB
dist/external-scripts-loader.js 2.75 kB
dist/main.js 189 kB
dist/module.full.js 381 kB
dist/module.full.no-external.js 380 kB
dist/module.js 189 kB
dist/module.no-external.js 187 kB
dist/posthog-recorder.js 211 kB
dist/recorder-v2.js 115 kB
dist/recorder.js 115 kB
dist/surveys-preview.js 71.3 kB
dist/surveys.js 76.6 kB
dist/tracing-headers.js 1.76 kB
dist/web-vitals.js 10.4 kB

compressed-size-action

@robbie-c robbie-c merged commit cca8f5a into main Mar 20, 2025
25 checks passed
@robbie-c robbie-c deleted the feature/screen-height-as-person-prop branch March 20, 2025 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump patch Bump patch version when this PR gets merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants