Skip to content

[PATCH] Track widget dashboard button clicks: AI Credits, GoodReserve, Superfluid Rewards #66

Description

@goodbounties-nanoclaw-agent

Amplitude project: NewGoodWallet

Adds click-tracking for widget dashboard buttons on the home screen, generalized so any current or future widget button can be wired the same way.

1. Add AICreditsTabSelected = "AICredits_Tab_Selected" to AnalyticsEventTypes (src/analytics/types.ts), plus the matching AnalyticsEvent union member. Fire it when the AI Credits action button (goodwidget.ai-credits) is tapped on the home screen dashboard.

2. Generalize the mechanism so it's not AI-Credits-only: a static widgetId -> event type map in src/sections/Home/components/WalletSection.tsx, mirroring the existing eventType map pattern in src/components/Snippet/Tabs/Tabs.tsx. The onClick on each widget action's Link looks up action.widgetId in this map and fires captureEvent if present. Core dashboard actions (Send/Receive/Swap/GoodDollar/Predictions/WalletConnect) are intentionally excluded - they only track action completion (Send_Succeeded, Swap_Succeeded, etc.), not the click itself.

3. Apply the same pattern to the other two widgets already on the dashboard:

  • GoodReserveTabSelected = "GoodReserve_Tab_Selected" for goodwidget.goodreserve
  • SuperfluidCampaignTabSelected = "SuperfluidCampaign_Tab_Selected" for goodwidget.superfluid-campaign

Event names are derived from each widget's stable widgetId (not the on-screen label), matching how AICredits_Tab_Selected was derived from ai-credits.

No custom event properties needed for any of the three events.

cc @laurence Weening

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions