Commit a51b615
committed
feat(analytics): wire growth event tracking on PostHog base
Add the analytics events the activation funnel needs from the desktop
client side, on top of the PR #778 PostHog migration:
- workspace_growth_rewards_click — fired when the sidebar "share nexu /
earn extra credits" growth banner is clicked.
- workspace_click_usage_detail — fired when the credits balance popup
"view usage detail" button is clicked.
- user_message_sent.state — controller analytics service now tags each
user_message_sent with state="Success" or state="false". Failure is
detected by openclaw:prompt-error transcript entries arriving before
the assistant response; success is the default and gets confirmed
when the assistant message lands.
- AnalyticsAuthSource type now also accepts "home" so the home page
can be the source of an auth click. The desktop side of the
signup_success / login_success plumbing (source pass-through to
cloud) is still pending — that side has to be done together with the
cloud auth-init schema and is intentionally left out of this commit.
The user_message_sent.credit_charged property the funnel spec also
mentions cannot be implemented client-side: there is no per-message
credit consumption pipeline yet. cloud's credit_usages table is empty
of llm-call entries, link writes link.usage_events (USD cost) but
nothing transforms USD into credit and writes credit_usages, and link
does not record channel either. That work belongs to the cloud team
under the existing credit consumption track and is documented in
specs/current/credit.md.1 parent be5cf2b commit a51b615
3 files changed
Lines changed: 44 additions & 1 deletion
File tree
- apps
- controller/src/services
- web/src
- layouts
- lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
217 | 220 | | |
218 | 221 | | |
219 | 222 | | |
| 223 | + | |
220 | 224 | | |
221 | 225 | | |
222 | 226 | | |
| |||
447 | 451 | | |
448 | 452 | | |
449 | 453 | | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
450 | 486 | | |
451 | 487 | | |
452 | 488 | | |
| |||
465 | 501 | | |
466 | 502 | | |
467 | 503 | | |
| 504 | + | |
468 | 505 | | |
469 | 506 | | |
470 | 507 | | |
| |||
491 | 528 | | |
492 | 529 | | |
493 | 530 | | |
| 531 | + | |
494 | 532 | | |
495 | 533 | | |
496 | 534 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
963 | 963 | | |
964 | 964 | | |
965 | 965 | | |
| 966 | + | |
966 | 967 | | |
967 | 968 | | |
968 | 969 | | |
| |||
1049 | 1050 | | |
1050 | 1051 | | |
1051 | 1052 | | |
| 1053 | + | |
1052 | 1054 | | |
1053 | 1055 | | |
1054 | 1056 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
212 | 215 | | |
213 | 216 | | |
214 | 217 | | |
| |||
0 commit comments