Tianji custom event tracking (auth, billing, chat) (#36) #45

Merged
westfarn merged 1 commits from feat/36-tianji-event-tracking into master 2026-07-27 08:40:19 -07:00
Owner

Summary

Closes #36.

Helpers / consent gating already exist from #42. This PR adds call sites + docs:

  • identifyAccount + AnalyticsSession (identify on session; Logout when auth ends)
  • Auth: Sign In / Sign Up / AuthCallback (SSO) success & fail
  • Billing: Checkout started, Payment Success / Canceled
  • Chat: Conversation Created, Message Sent (metadata only — no prompt text)
  • ToS Acknowledged
  • BILLING_PORTAL_OPENED reserved until Account portal (#33)
  • Catalog: llm-fe/ANALYTICS.md

No chat_backend changes required.

Test plan

  • Grant consent on beta → sign in → Tianji shows Login Success + identify
  • Decline consent → same actions produce no custom events (page views still ok)
  • Sign up + checkout + cancel/success return URLs fire expected events
  • New chat + send message → Conversation Created / Message Sent without prompt text
  • Acknowledge ToS → ToS Acknowledged
  • npm run test:ci -- --testPathPattern='analytics.test|SignIn.test|SignUp.test|AuthCallback.test'
## Summary Closes #36. Helpers / consent gating already exist from [#42](https://git.aimloperations.com/ai_ml_operations/chat_web_app/pulls/42). This PR adds **call sites** + docs: - `identifyAccount` + `AnalyticsSession` (identify on session; `Logout` when auth ends) - Auth: Sign In / Sign Up / AuthCallback (SSO) success & fail - Billing: Checkout started, Payment Success / Canceled - Chat: Conversation Created, Message Sent (metadata only — no prompt text) - ToS Acknowledged - `BILLING_PORTAL_OPENED` reserved until Account portal (#33) - Catalog: [`llm-fe/ANALYTICS.md`](llm-fe/ANALYTICS.md) No `chat_backend` changes required. ## Test plan - [ ] Grant consent on beta → sign in → Tianji shows Login Success + identify - [ ] Decline consent → same actions produce no custom events (page views still ok) - [ ] Sign up + checkout + cancel/success return URLs fire expected events - [ ] New chat + send message → Conversation Created / Message Sent without prompt text - [ ] Acknowledge ToS → ToS Acknowledged - [ ] `npm run test:ci -- --testPathPattern='analytics.test|SignIn.test|SignUp.test|AuthCallback.test'`
westfarn force-pushed feat/36-tianji-event-tracking from a0a034bbf8 to 3a4a463416 2026-07-27 07:51:36 -07:00 Compare
westfarn added 1 commit 2026-07-27 08:37:07 -07:00
Wire Tianji custom event tracking for auth, billing, and chat (#36)
Unit Tests / test (pull_request) Successful in 13s
d6f6698a15
Add identifyAccount + AnalyticsSession, instrument MVP funnel call sites without PII payloads, and document event names in ANALYTICS.md. Billing portal event reserved until #33.
westfarn force-pushed feat/36-tianji-event-tracking from 3a4a463416 to d6f6698a15 2026-07-27 08:37:07 -07:00 Compare
westfarn merged commit 347fa75534 into master 2026-07-27 08:40:19 -07:00
westfarn deleted branch feat/36-tianji-event-tracking 2026-07-27 08:40:19 -07:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ai_ml_operations/chat_web_app#45