Quick Disable
To disable all analytics tracking, change theENABLE_POSTHOG flag in the background script:
background.js:2
false, all tracking stops immediately. No other changes are needed.
Configuration Flag
The analytics system is controlled by a feature flag at the top of the background script:background.js:1-4
This flag must be changed before building the extension. After changing, run
./build-all.sh to rebuild.Initialization
PostHog is conditionally initialized based on the flag:background.js:9-14
Wrapper Functions
All tracking calls use wrapper functions that check the feature flag:Safe Track Event
background.js:16-21
Safe Identify User
background.js:23-27
Events Tracked
When analytics is enabled, the following events are tracked:Extension Lifecycle
Extension Installed:background.js:33-37
background.js:38-42
background.js:46-48
Agent Activity
Agent detection, navigation blocking, and action blocking events are tracked to help understand how security rules are being used.Data Collected
When analytics is enabled, PostHog collects:- Session Events - When agent mode starts/stops
- Blocking Events - When navigation or actions are blocked
- Rule Changes - When users update blocking/governance rules
- Extension Lifecycle - Install, update, startup events
- User Identification - Email (only if authentication is enabled)
No personal browsing data is collected. Only metadata about agent sessions and rule usage is tracked.
PostHog Configuration
The PostHog configuration is stored in a separate file:posthog-config.js
- PostHog API host:
https://us.i.posthog.com - PostHog initialization settings
- Event tracking functions
- User identification functions
Permissions
The extension’s Content Security Policy includes PostHog:manifest.json:51
Complete Removal (Optional)
If you want to completely remove PostHog from the codebase:Just setting
ENABLE_POSTHOG = false is sufficient to disable all tracking. Complete removal is optional.Privacy Considerations
What is NOT Tracked
- Specific URLs visited during agent sessions
- Page content or screenshots
- Personal data from web pages
- Browsing history
- Cookies or authentication tokens
What IS Tracked
- Extension version numbers
- Number of agent sessions started/stopped
- Number of blocking rules configured
- Types of blocking events (URL, action, governance)
- User email (only if authentication is enabled)
Data Storage
- Data is stored on PostHog’s servers (US region)
- PostHog is self-hosted analytics (not Google Analytics)
- No third-party cookies are used
- Users can disable analytics with one line change
Testing Analytics
To test that analytics is properly disabled:Environment-Specific Configuration
You can use different analytics settings for development vs. production:Best Practices
- Disclose to Users: Include analytics disclosure in your privacy policy
- Respect Privacy: Only enable analytics if you need usage insights
- Test Disabled State: Verify the extension works properly with analytics off
- Document Changes: Keep notes on why analytics is enabled/disabled
- Review Events: Periodically review what events are being tracked
Related Documentation
- PostHog Documentation - Official PostHog docs
- Source:
chrome-extension/background.js- Feature flag location - Source:
chrome-extension/posthog-config.js- PostHog initialization - Source:
POSTHOG.md- Detailed PostHog implementation guide