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
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"toAnalyticsEventTypes(src/analytics/types.ts), plus the matchingAnalyticsEventunion 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 typemap insrc/sections/Home/components/WalletSection.tsx, mirroring the existingeventTypemap pattern insrc/components/Snippet/Tabs/Tabs.tsx. TheonClickon each widget action'sLinklooks upaction.widgetIdin this map and firescaptureEventif 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"forgoodwidget.goodreserveSuperfluidCampaignTabSelected = "SuperfluidCampaign_Tab_Selected"forgoodwidget.superfluid-campaignEvent names are derived from each widget's stable
widgetId(not the on-screen label), matching howAICredits_Tab_Selectedwas derived fromai-credits.No custom event properties needed for any of the three events.
cc @laurence Weening