Skip to content

Instantly share code, notes, and snippets.

@calderaro
Created October 6, 2025 16:07
Show Gist options
  • Select an option

  • Save calderaro/6b1f876e817476a6c05ed64bd72ba994 to your computer and use it in GitHub Desktop.

Select an option

Save calderaro/6b1f876e817476a6c05ed64bd72ba994 to your computer and use it in GitHub Desktop.

useAnalytics track Usage Inventory

LOGOUT_SUCCESSFUL — src/hooks/useLogout.ts:13

Description: Fires once the Privy logout and Intercom logout complete successfully, marking the end of a user session. Context Properties: None.

FUNDS_ADDED — src/components/FundingAmountModal.tsx:87

Description: Emitted when a user confirms a deposit from the funding amount modal. Context Properties:

  • balance_before: USD wallet balance before initiating the deposit; helps quantify top-ups relative to standing funds.
  • amount: Raw amount entered by the user for the deposit; mirrors UI input for auditing.
  • amount_usd: Deposit amount normalized to USD; useful if the UI ever allows other denominations.

FUNDS_WITHDRAWN — src/components/FundingAmountModal.tsx:173

Description: Triggered when a user confirms a withdrawal from the funding amount modal. Context Properties:

  • balance_before: USD wallet balance prior to the withdrawal; measures liquidity impact.
  • amount: Raw amount requested for withdrawal; directly reflects UI input.
  • amount_usd: Withdrawal amount normalized to USD; enables consistent financial reporting.

onboarding_completed — src/components/onboarding/OnboardingFooter.tsx:40

Description: Sent after the user taps “Get Started” to finish the onboarding carousel. Context Properties:

  • screen: Hard-coded to Onboarding; identifies the completion surface in analytics queries.

DEPOSIT — src/utils/firebase.ts:168

Description: Raised in response to a deposit-successful push notification, even if the user does not interact with the UI. Context Properties:

  • amount: Amount credited by the backend; pairs with notification ID for reconciliation.
  • token_symbol: Asset symbol credited (e.g., USDC); differentiates fiat from token deposits.

account_deleted — src/components/DeleteAccountConfirmationModal.tsx:28

Description: Fires when the delete-account mutation succeeds, confirming irreversible account removal. Context Properties: None.

LOG_IN — src/components/login/EmailLoginModal.tsx:39

Description: Emitted when an email magic-link login completes successfully. Context Properties:

  • provider: Always email; distinguishes authentication channel across unified metrics.
  • created_at: ISO timestamp from Privy; indicates account age at login.
  • userId: Privy user identifier; allows cross-system joins.
  • linked_accounts: Array describing connected auth providers; highlights multi-channel usage.

LOG_IN — src/components/login/SmsLoginModal.tsx:39

Description: Fired upon successful SMS code authentication. Context Properties:

  • provider: Always sms; distinguishes the SMS path in aggregate reporting.
  • created_at: ISO timestamp from Privy; contextualizes tenure.
  • userId: Privy user identifier; enables cohort joins.
  • linked_accounts: Connected auth providers; surfaces multi-factor adoption.

LOG_IN — src/components/login/LoginButtons.tsx:67

Description: Sent when an OAuth flow (Google, Twitter, Apple) resolves successfully via the login modal. Context Properties:

  • provider: OAuth provider string (google, twitter, or apple); measures channel mix.
  • created_at: ISO timestamp from Privy; informs user age distribution.
  • userId: Privy user identifier; ties event to backend records.
  • linked_accounts: Connected auth providers; identifies multi-account users.

purchase / SALE_SUCCESSFUL — src/screens/TradingScreen.tsx:164

Description: purchase fires after a successful buy, while SALE_SUCCESSFUL fires after a successful sell within the trading flow. Context Properties:

  • amount: Raw trade quantity entered in the UI (base currency amount).
  • amount_usd: Trade size normalized to USD text input; enables monetary aggregation.
  • token_symbol: Traded asset symbol; distinguishes per-token performance.

click — src/components/trade/SuccessTrade.tsx:149

Description: Captures taps on the “View token” button shown after a successful trade. Context Properties:

  • target_text: Captures the button label (view token); separates this CTA from others.
  • operation: Indicates whether the prior action was buy or sell.
  • token_symbol: Symbol of the traded asset; reveals post-trade interest per token.
  • amount: Trade quantity; connects follow-up engagement to transaction size.
  • screen: Always SuccessTrade; identifies the originating screen.

click — src/components/trade/SuccessTrade.tsx:179

Description: Logged when users choose “Back Home” on the post-trade success screen. Context Properties:

  • target_text: Button label (back home); distinguishes this exit option.
  • operation: buy or sell; captures previous trade direction.
  • token_symbol: Symbol of the traded asset; enables token-level churn analysis.
  • amount: Trade quantity; relates exit behavior to trade size.
  • screen: SuccessTrade; tags the surface.

click — src/components/EnableNotifications.tsx:33

Description: Fired when a user taps “Enable notifications” within the notifications permission prompt. Context Properties:

  • target_text: The CTA copy (enable notifications); allows A/B comparisons if text changes.
  • screen: EnableNotificationsModal; contextualizes the funnel stage.

click — src/components/trade/TradingHeader.tsx:30

Description: Tracks taps on the back button in the trading header. Context Properties:

  • target_text: Button identity (back); separates from other navigation controls.
  • screen: Trading; anchors the event to the trading screen.

click — src/components/trade/TradingHeader.tsx:38

Description: Logged whenever a user toggles between buy and sell tabs in the trading header. Context Properties:

  • target_text: Current operation identifier (buy or sell); indicates destination tab.
  • screen: Trading; notes the active screen.

click — src/components/trade/TradingHeader.tsx:49

Description: Captures presses on the deposit shortcut button within the trading header. Context Properties:

  • target_text: CTA label (deposit); differentiates this funding entry point.
  • screen: Trading; indicates the trigger context.

click — src/components/FundingMethodButtons.tsx:38

Description: Produced when the “Debit Card” option is chosen in the funding method dialog. Context Properties:

  • target_text: Label (debit card); distinguishes the selected method.
  • screen: FundingMethodModal; records the touchpoint.
  • module_type: Constant FUNDING_METHOD_MODAL; useful for grouping related UI modules.

click — src/components/FundingMethodButtons.tsx:60

Description: Fired when “Crypto (Solana)” is selected as the funding method. Context Properties:

  • target_text: Label (crypto); signals on-chain preference.
  • screen: FundingMethodModal; notes source surface.
  • module_type: FUNDING_METHOD_MODAL; facilitates module-level rollups.

click — src/components/FundingAmountModal.tsx:377

Description: Tracks presses on the primary CTA in the funding amount modal (deposit or withdraw). Context Properties:

  • target_text: Indicates whether the CTA initiated a deposit or withdraw action.
  • amount: Current amount entered; helps assess readiness vs. eventual completion events.
  • screen: FundingAmountModal; provides context for the flow.
  • module_type: FUNDING_AMOUNT_MODAL; aids in module analytics.

click — src/components/discover/AISummary.tsx:110

Description: Captures engagement with the AI-generated market summary block in Discover. Context Properties:

  • target_text: Static identifier (ai_summary); separates from other Discover CTAs.
  • screen: Discover; records the entry point.
  • module_type: AI_SUMMARY; ties interactions to the AI feature.

click — src/components/discover/DiscoverSortButton.tsx:48

Description: Emitted when the Discover sort button is tapped to open the sort modal. Context Properties:

  • target_text: Human-readable sort name (e.g., Trending); shows currently applied sort.
  • screen: Discover; anchors the event.
  • module_type: SORT_BUTTON; groups sorting-related events.

click — src/screens/SettingsScreen.tsx:119

Description: Fired for each press on an enabled Settings list item. Context Properties:

  • target_text: Menu label tapped; prioritizes features by demand.
  • screen: Settings; clarifies origin.
  • module_type: SETTINGS_BUTTON; isolates settings interactions.
  • item_position: 1-based index of the item; supports UI ordering experiments.
  • item_total: Total items in the dataset; contextualizes position analytics.

click — src/screens/SettingsScreen.tsx:147

Description: Captures taps on the logout button inside Settings. Context Properties:

  • target_text: Label (logout); distinguishes logout intent here.
  • screen: Settings; marks the screen of origin.

click — src/screens/SettingsScreen.tsx:155

Description: Logged when the “Delete My Account” prompt in Settings is tapped. Context Properties:

  • target_text: Label (delete account); singles out destructive intent.
  • screen: Settings; provides context.

click — src/components/discover/DiscoverTopSectionLoadMoreButton.tsx:54

Description: Fired when users toggle the holdings list between collapsed and expanded states. Context Properties:

  • target_text: Either open or close; indicates resulting state.
  • screen: Discover; notes location.
  • module_type: HOLDINGS_LOAD_MORE_BUTTON; links to holdings UI.

click — src/components/DiscoverHeader.tsx:78

Description: Captures taps on the “Sign in” hero button shown to guests on Discover. Context Properties:

  • target_text: Label (sign in); differentiates from other sign-in prompts.
  • screen: Discover; marks the top-of-funnel entry.
  • module_type: HEADER_PORTFOLIO_VALUE; connects to the hero card module.

click — src/components/DiscoverHeader.tsx:146

Description: Logged when a signed-in user taps the hero deposit button on Discover. Context Properties:

  • target_text: Label (deposit); identifies the CTA.
  • screen: Discover; context of action.
  • module_type: HEADER_DEPOSIT; tracks hero funding engagement.

click — src/components/DiscoverHeader.tsx:159

Description: Triggered when a user with balance taps the hero withdraw button on Discover. Context Properties:

  • target_text: Label (withdraw); distinguishes the CTA.
  • screen: Discover; records location.
  • module_type: HEADER_WITHDRAW; groups hero withdrawal actions.

click — src/components/discover/DiscoverTopSection.tsx:242

Description: Emitted when logged-out users use the “Sign in” CTA within the holdings preview. Context Properties:

  • target_text: Label (sign in); disambiguates from other prompts.
  • screen: Discover; identifies the screen.
  • module_type: HOLDINGS_EXPANDED; ties to the holdings preview module.

click — src/components/discover/DiscoverSearchBar.tsx:188

Description: Captures taps on the “News” pill in the Discover search bar. Context Properties:

  • target_text: Label (news); marks the destination.
  • screen: Discover; notes location.
  • module_type: NEWS_BUTTON; connects to news surfacing experiments.

click — src/components/withdraw/WithdrawalMethodModal.tsx:76

Description: Fired when “Coinbase” is selected as the withdrawal method. Context Properties:

  • target_text: Label (coinbase); records user preference.
  • screen: WithdrawalMethodModal; identifies the modal.
  • module_type: MODAL; general modal categorization.

click — src/components/withdraw/WithdrawalMethodModal.tsx:97

Description: Logged when users choose “Solana Wallet” for withdrawals. Context Properties:

  • target_text: Label (solana wallet); indicates destination.
  • screen: WithdrawalMethodModal; context for the choice.
  • module_type: MODAL; modal grouping.

click — src/components/withdraw/WithdrawalMethodModal.tsx:118

Description: Captures selection of “Paypal” as the withdrawal option. Context Properties:

  • target_text: Label (paypal); identifies payment rail preference.
  • screen: WithdrawalMethodModal; modal context.
  • module_type: MODAL; groups modal interactions.

click — src/components/withdraw/WithdrawalMethodModal.tsx:139

Description: Fired when “Venmo” is chosen as the withdrawal method. Context Properties:

  • target_text: Label (venmo); captures payout preference.
  • screen: WithdrawalMethodModal; context surface.
  • module_type: MODAL; ties to modal analytics.

click — src/components/withdraw/SolanaWithdrawSuccess.tsx:75

Description: Logged when the user taps “Done” on the withdrawal success modal. Context Properties:

  • target_text: Label (done); signals exit intent.
  • screen: SolanaWithdrawSuccess; identifies modal.
  • module_type: MODAL; categorizes the surface.

click — src/components/withdraw/SolanaWithdrawSuccess.tsx:90

Description: Captures taps on “View Details” from the withdrawal success screen. Context Properties:

  • target_text: Label (view details); notes follow-up interest.
  • screen: SolanaWithdrawSuccess; modal context.
  • module_type: MODAL; module grouping.

click — src/screens/TokenDetailsScreen.tsx:334

Description: Emitted when users press the trade buttons (buy/sell) on token details. Context Properties:

  • target_text: Operation tapped (buy or sell); identifies intention.
  • screen: TokenDetails; source screen.
  • module_type: TRADE_BUTTON; ties to trade CTAs.

click — src/components/withdraw/SolanaReviewWithdrawalModal.tsx:218

Description: Tracks successful holds on the “Hold to confirm” withdrawal button. Context Properties:

  • target_text: Copy (Hold to confirm); distinguishes confirmation vs retry.
  • operation: Fixed transfer; indicates withdrawal type.
  • token_symbol: Hard-coded USDC; the asset being transferred.
  • amount: Entered withdrawal amount; ties success to value.
  • screen: SolanaReviewWithdrawalModal; identifies modal.
  • module_type: WITHDRAW_BUTTON; groups key action control.

click — src/components/withdraw/SolanaReviewWithdrawalModal.tsx:314

Description: Fired when users hold the “Hold to try again” button after a failed withdrawal. Context Properties:

  • target_text: Copy (Hold to try again); signals recovery action.
  • operation: transfer; indicates withdrawal flow.
  • token_symbol: USDC; asset being retried.
  • amount: Requested withdrawal amount; useful for diagnosing failures.
  • screen: SolanaReviewWithdrawalModal; modal context.
  • module_type: WITHDRAW_BUTTON; ties to the same control family.

click — src/screens/TradingScreen.tsx:470

Description: Logged when the “Add Funds” button appears due to balance shortfall and the user taps it. Context Properties:

  • target_text: Label (add funds); identifies upsell CTA.
  • amount_usd: Suggested funding amount to cover the shortfall; measures friction severity.
  • screen: Trading; indicates context.
  • module_type: TRADE_BUTTON; groups funding/trade CTAs.

click — src/screens/TradingScreen.tsx:488

Description: Captures activations of the swipe-to-trade CTA when users confirm a buy or sell. Context Properties:

  • target_text: Operation label (buy or sell); clarifies direction.
  • operation: Mirrors target_text; redundant safeguard for analytics.
  • token_symbol: Asset selected for the trade; key for product metrics.
  • amount: Entered trade amount; gauges scale of attempts.
  • amount_usd: USD-normalized trade amount; supports revenue analytics.
  • screen: Trading; identifies screen.
  • module_type: TRADE_BUTTON; links to CTA performance.

click — src/components/discover/DiscoverSortModal.tsx:32

Description: Emitted when a new sort option is chosen inside the Discover sort modal. Context Properties:

  • target_text: Selected sort label; records preference (e.g., Top Gainers).
  • screen: DiscoverSortModal; identifies modal.
  • module_type: SORT_BUTTON; groups sorting interactions.

click — src/components/discover/DiscoverSearchFilters.tsx:42

Description: Fires when a Discover tag filter pill is toggled. Context Properties:

  • target_text: Tag label; indicates taxonomy engagement.
  • screen: Discover; records surface.
  • module_type: FILTER_TAG_BUTTON; groups filter usage.
  • item_position: 1-based index in the rendered list; helps evaluate ordering.
  • item_total: Total count of available tags; contextualizes position metric.

click — src/components/discover/NotificationsPressable.tsx:45

Description: Logged when the notifications bell in Discover is tapped. Context Properties:

  • screen: Discover; marks the entry point to notifications.
  • module_type: NOTIFICATIONS_BUTTON; groups navigation to inbox.

click — src/components/discover/DiscoverCoinCard.tsx:41

Description: Captures presses on any coin card within the Discover list. Context Properties:

  • target_text: Static identifier (coin); distinguishes card taps from other CTAs.
  • screen: Discover; notes origin screen.
  • module_type: COIN_CARD; groups per-card engagement.
  • token_symbol: Symbol of the selected token; links to detail page visits.
  • item_position: 1-based index of the card; studies list positioning effects.
  • item_total: Total cards rendered; offers pagination context.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment