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: Add screen dimensions and UA as person property #30222

Merged

Conversation

robbie-c
Copy link
Member

Problem

These are needed for some conversion destinations

See also PostHog/posthog-js#1840

Changes

Add screen / viewport dimensions and user agent as person properties

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

n/a

@robbie-c robbie-c requested a review from MarconLP March 20, 2025 14:49
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

This PR adds screen dimensions and user agent information as person properties in PostHog, enabling these attributes to be used for conversion destinations.

  • Added $screen_height, $screen_width, $viewport_height, $viewport_width, and $raw_user_agent to PERSON_PROPERTIES_ADAPTED_FROM_EVENT in /frontend/src/lib/taxonomy.tsx
  • Added same properties to eventToPersonProperties set in /plugin-server/src/utils/db/utils.ts for automatic capture
  • Properties will be automatically adapted from events to person objects through existing property adaptation system

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

Copy link
Contributor

Size Change: +43 B (0%)

Total Size: 9.75 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 9.75 MB +43 B (0%)

compressed-size-action

@robbie-c robbie-c merged commit aede7ca into master Mar 20, 2025
107 checks passed
@robbie-c robbie-c deleted the feature/add-screen-dimensions-and-ua-as-person-property 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants