Skip to content

chore(analytics): add tipping flow tracking (scan funnel + sent tip) - #1141

Merged
bmc08gt merged 1 commit into
code/cashfrom
chore/tipping-analytics
Jul 24, 2026
Merged

chore(analytics): add tipping flow tracking (scan funnel + sent tip)#1141
bmc08gt merged 1 commit into
code/cashfrom
chore/tipping-analytics

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

What

Adds analytics to the tipping flows, mirroring the existing send/chat analytics (Sent Cash / Sent Message). Covers both the scanned tip-card flow and the chat side.

New events

Event Fires when Properties
Tip Card Scanned An OpenCode tip payload is scanned (CodeScanDelegate.onTipCardScanned)
Tip Card Presented A scanned/deeplinked tip card resolves and is presented (TipCardDelegate)
Sent Tip A tip completes — from the scanned-card flow or an in-chat tip DM Fiat, Currency, State, … (same as Sent Cash)

Existing Sent Message now carries a Chat Type property (Tip / Contact / Unknown).

This gives a funnel: Tip Card Scanned → Tip Card Presented → Sent Tip.

How

  • Analytics.Transfer.SentTip → standalone "Sent Tip" event (fired via the existing transfer() plumbing, so it carries amount/state/error). Intentionally not a ChatEvent, since the scanned-card path is not a chat.
  • AnalyticsEvent.TipCardEvent.Scanned / .Presented, plus tipCardScanned() / tipCardPresented() on the service interface (wired through MixpanelAnalyticsDelegate and the stub).
  • messageSentInChat(type: ChatType, …)ChatViewModel derives the type from the resolved participant (TipUserTIP_DM, ContactCONTACT_DM).
  • In-chat payments branch to SentTip vs SentCash on participant type.
  • TippingCoordinator.confirmTip() — injected FlipcashAnalyticsService and activated the previously commented-out tracking as SentTip.

Testing

  • :analytics, :session, :tipping, :messenger all compile (compileDebugKotlin).
  • No behavior change beyond analytics emission.

Instrument the tipping flows, mirroring the existing send/chat analytics.

Scanned tip-card funnel:
- "Tip Card Scanned"   — CodeScanDelegate.onTipCardScanned (on scan)
- "Tip Card Presented" — TipCardDelegate resolve success (scan + deeplink)
- "Sent Tip"           — TippingCoordinator.confirmTip success/failure
  (analytics injected; previously commented-out tracking activated)

Chat side:
- In-chat payments fire "Sent Tip" for tip DMs, "Sent Cash" otherwise
- "Sent Message" now carries a "Chat Type" property (Tip/Contact/Unknown)
  via messageSentInChat(type)

Adds Analytics.Transfer.SentTip and AnalyticsEvent.TipCardEvent
(Scanned/Presented), wired through the Mixpanel delegate and stub.
@github-actions github-actions Bot added type: chore Maintenance, config, CI/CD area: session labels Jul 24, 2026
@bmc08gt
bmc08gt merged commit e28dedc into code/cash Jul 24, 2026
2 of 3 checks passed
@bmc08gt
bmc08gt deleted the chore/tipping-analytics branch July 24, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: session type: chore Maintenance, config, CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant