Skip to content

Commit 0ae14b1

Browse files
sodiumsunclaude
andcommitted
analytics: distinct power_trial_started event (vs generic trial_started)
PostHog couldn't tell a Power-trial signup from a Pro/managed-trial signup — both fired trial_started. Now every path that starts a Power trial (sign-in auto-enroll, the Settings button, the daemon self-heal net) fires power_trial_started with a method property (signin | button | daemon_net), so Power vs Pro trial funnels are separable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019GTBZjBGurqsHUHsjaU1gA
1 parent c5c74a9 commit 0ae14b1

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

heard/daemon.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,6 +1265,12 @@ def _maybe_autostart_power_trial(self, me: dict) -> None:
12651265
config.set_value("heard_trial_expires_at", exp)
12661266
config.set_value("power_trial_used", True)
12671267
_log("power_trial_autostarted", via="daemon_poll")
1268+
try:
1269+
from heard import analytics
1270+
1271+
analytics.capture("power_trial_started", {"method": "daemon_net"})
1272+
except Exception:
1273+
pass
12681274
self._reload_config()
12691275
else:
12701276
_log("power_trial_autostart_noop", reason=str(data.get("reason") or "not_power"))

heard/home_window.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,12 @@ def _work():
830830
exp = int(data.get("trial_expires_at") or 0)
831831
if exp:
832832
config.set_value("heard_trial_expires_at", exp)
833+
try:
834+
from heard import analytics
835+
836+
analytics.capture("power_trial_started", {"method": "button"})
837+
except Exception:
838+
pass
833839
_reload_daemon()
834840
else:
835841
# trial_used / ineligible — tell the user, stay put.

heard/url_scheme.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ def _maybe_start_power_trial(token: str) -> None:
105105
if exp:
106106
config.set_value("heard_trial_expires_at", exp)
107107
print(f"[power_trial] sign-in autostart OK (exp={exp})")
108+
try:
109+
from heard import analytics
110+
111+
analytics.capture("power_trial_started", {"method": "signin"})
112+
except Exception:
113+
pass
108114
else:
109115
# Not power — usually a brand-new-account race (account not queryable
110116
# yet). The daemon's /v1/me poll retries this within ~5 min, so it

0 commit comments

Comments
 (0)