Files
OpenHands/__tests__/services
Rohit Malhotraandopenhands 48b275a94f feat: track install immediately and use reverse proxy for ad blocker bypass (#155)
* feat: track install immediately without consent, add proxy support

BREAKING CHANGE: Install event (canvas_install) is now sent immediately
on first use, regardless of consent status. Users can still opt out via
VITE_DO_NOT_TRACK=1 or browser's Do Not Track setting.

Changes:
- trackInstall() sends the install event immediately without waiting for consent
- trackFirstUse() is now deprecated, calls trackInstall() for backward compat
- Session/custom events still require user consent
- Add VITE_POSTHOG_UI_HOST env var for reverse proxy support
- PostHog initialization now includes ui_host configuration

This change allows tracking library adoption even if users haven't made
a consent choice yet, while still respecting hard opt-outs.

Co-authored-by: openhands <openhands@all-hands.dev>

* feat: default PostHog host to z.openhands.dev proxy

Use OpenHands' managed reverse proxy by default to bypass ad blockers.
The proxy at z.openhands.dev routes telemetry to PostHog's US region.

Library consumers can still override with VITE_POSTHOG_HOST if needed.

Co-authored-by: openhands <openhands@all-hands.dev>

* chore: remove deprecated trackFirstUse function

Only trackInstall() is now exported. No backwards compatibility shim needed.

Co-authored-by: openhands <openhands@all-hands.dev>

* docs: add privacy/GDPR compliance notes to install tracking

Address review feedback by documenting the privacy implications and
GDPR legal basis (legitimate interest under Article 6(1)(f)) for
sending the anonymous install event before consent.

Co-authored-by: openhands <openhands@all-hands.dev>

* fix: wait for translations before showing consent modal

- Use useTranslation's 'ready' state to wait for translations to load
- Add small delay (50ms) to ensure DOM is fully hydrated
- Prevents translation keys from flashing on first appearance

Co-authored-by: openhands <openhands@all-hands.dev>

---------

Co-authored-by: openhands <openhands@all-hands.dev>
2026-05-07 14:29:32 -04:00
..