Skip to content

Conversation

leoisadev8
Copy link
Contributor

Summary

  • Introduces a comprehensive PostHog instrumentation blueprint for the OpenChat monorepo (web, server, extension).
  • Documents baseline setup, core event taxonomy, common properties, dashboards, and per-file implementation notes.
  • Provides a clear naming convention and rollout plan to guide analytics instrumentation.

Changes

Documentation

  • Added new file: posthog.md containing the PostHog Event Plan with detailed guidance across sections 1–6 and next steps.

Details

1. Baseline Setup & Guardrails

  • Guidelines for client bootstrap, server capture, identity handling, and super-properties.
  • Emphasizes lazy initialization, guarded captures, and consistent user/workspace attribution.

2. Core Event Taxonomy

  • Defines a comprehensive set of events (naming convention: scope.action, snake_case).
  • Includes events across marketing, authentication, chat, settings, OpenRouter, extension, etc., with trigger points and key properties.
  • Encourages alignment with existing events (e.g., auth.sign_in, chat_message_submitted) while standardizing new additions.

3. Common Properties

  • Lists super-properties to register globally on the client and server: auth_state, workspace_id, model_id, ui_theme, brand_theme, app_version, deployment, etc.
  • Defines server-side properties like origin, ip_hash, latency/status metrics.

4. Dashboards & Insights

  • Proposes dashboards to monitor activation, chat health, sync reliability, personalization adoption, attachments, model performance, and guest vs. authenticated retention.
  • Suggests slicing data by relevant dimensions (referrers, deployments, models, themes, etc.).

5. Implementation Notes by File

  • Outlines where instrumentation should be added or extended across key files (web components, chat flow, settings, sync, server routers, and extension entry points).
  • Emphasizes incremental rollout and alignment with existing code paths.

6. Next Steps

  • Align engineering on naming conventions and property casing.
  • Implement super-property registration and session provenance first.
  • Iterate with feature flags, validate in PostHog, and build dashboards iteratively.

Rationale

  • This plan provides a single source of truth for instrumenting OpenChat with PostHog.
  • Enables cross-team alignment on event coverage, properties, and dashboards.
  • Facilitates early signal detection for acquisition, onboarding friction, usage patterns, and extension adoption.

Implementation Notes

  • The plan is intended as guidance and should be implemented progressively, with a focus on core flows first (landing, sign-in/up, chat, and settings).
  • Names, properties, and event surface should be refined during implementation to ensure consistency with existing events.

Next Steps

  • Review for naming consistency and property coverage.
  • Start with baseline client/server setup and onboarding events.
  • Roll out dashboards in the order outlined, collecting stakeholder feedback.

Test plan

  • Review the document for completeness and alignment with codebase.
  • Validate naming conventions (scope.action) and property casing (snake_case).
  • Plan incremental rollout behind a feature flag and verify events in Live feed.
  • Create initial dashboards and verify data correctness with stakeholders.

🌿 Generated by Terry


ℹ️ Tag @terragon-labs to ask questions and address PR feedback

📎 Task: https://www.terragonlabs.com/task/1eaeaaf1-cdf8-4da7-af98-d13372cfa049

leoisadev8 and others added 6 commits October 15, 2025 22:34
…on guide

This commit introduces a detailed PostHog instrumentation blueprint for the OpenChat monorepo, covering web, server, and extension components. It outlines baseline setup, event taxonomy with triggers and properties, common properties, dashboards and insights strategies, implementation notes by file, and next steps for full analytics coverage.

Key additions include event naming conventions, super-property registrations, enhanced event properties for auth, chat, settings, sync, and extension features, as well as recommended dashboard KPIs and monitoring plans to track acquisition, onboarding, chat health, personalization, and extension engagement.

This documentation will guide engineering alignment and implementation to enable actionable analytics through PostHog.

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
…trumentation

- Reduced and optimized core event sets to focus on high-leverage insights, minimizing low-signal noise.
- Standardized event naming conventions to lowercase snake_case with scope.action structure.
- Updated super-properties registration for better session identification including guest handling.
- Enhanced event properties for chat creation, streaming, attachments, and OpenRouter API key lifecycle.
- Added new telemetry events for sync connection state, fallback storage usage, and chat rate limiting.
- Revised dashboard and funnel definitions to reflect streamlined event model and metrics.
- Improved implementation notes for consistency and expanded coverage across web, server, and extension components.

This update enables effective monitoring of acquisition, chat usage, reliability, and onboarding activation without excess event volume.

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
- Added full text of GNU Affero General Public License version 3 in LICENSE file
- Updated README.md with license information referencing the new LICENSE file

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
…mtzz

Add GNU AGPLv3 license and README notice
…license-ommtzz

Revert "Add GNU AGPLv3 license and README notice"
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.

1 participant