chore: add more metrics to trending flow#25375
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
|
|
||
| // TODO: Remove before merging - temporary debug log | ||
| // eslint-disable-next-line no-console | ||
| console.log('🔍 TRENDING_FEED_VIEWED [search]', analyticsProperties); |
|
|
||
| // TODO: Remove before merging - temporary debug log | ||
| // eslint-disable-next-line no-console | ||
| console.log('⚙️ TRENDING_FEED_VIEWED [filter_change]', analyticsProperties); |
|
The session cleanup in here uses The Predict flow works correctly because they have a "Back" button which actually unmounts the screen, triggering the cleanup. Any advices on how this can be fixed? Update: fixed here c5a94fe |
app/components/UI/Trending/services/TrendingFeedSessionManager.ts
Outdated
Show resolved
Hide resolved
app/components/Views/TrendingTokens/TrendingTokensFullView/TrendingTokensFullView.tsx
Outdated
Show resolved
Hide resolved
app/components/Views/TrendingView/components/ExploreSearchResults/ExploreSearchResults.tsx
Show resolved
Hide resolved
app/components/Views/TrendingTokens/TrendingTokensFullView/TrendingTokensFullView.tsx
Show resolved
Hide resolved
app/components/UI/Trending/hooks/useSearchTracking/useSearchTracking.ts
Outdated
Show resolved
Hide resolved
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The Trending feature has dedicated E2E tests in
Running SmokeWalletPlatform will verify that:
The changes are primarily analytics additions and don't modify core business logic, but the TabBar modification and session management integration warrant verification through E2E tests. Performance Test Selection:
These analytics changes don't impact:
The changes are additive tracking code that runs asynchronously and doesn't block user interactions. No performance tests are needed. |
|



Description
This PR extends the
TRENDING_FEED_VIEWEDanalytics event with aninteraction_typediscriminator pattern to track detailed user interactions within the Trending feed.Related: https://github.com/Consensys/segment-schema/pull/440
Background
The existing
TRENDING_FEED_VIEWEDevent (PR #23674) tracks session-level metrics (session_id, session_time, entry_point, is_session_end). This PR adds granular interaction tracking.Changes
Added
interaction_typediscriminator - All events now include aninteraction_typefield to distinguish between:session_start,session_end,token_click,search,filter_changeToken Click Tracking - Tracks when users tap on tokens from the Trending feed, including position, price data, and active filter context
Search Tracking - Tracks search queries with debounce (500ms), including result counts and filter context
Filter Change Tracking - Tracks when users change time, sort, or network filters, including previous and new values
Filter Context Propagation - Added
TrendingFilterContextinterface and propagated it throughTrendingTokensList→TrendingTokenRowItemfor analytics contextDebug Console Logs for Testing
Temporary console.logs have been added to help verify the events fire correctly.
File:
app/components/UI/Trending/services/TrendingFeedSessionManager.tsSession Start/End (in
trackEventmethod, after line 256):Token Click / Search / Filter Change (in
trackInteractionmethod, after line 296):New Analytics Attributes
Interaction Types
interaction_typesession_startsession_endtoken_clicksearchfilter_changeToken Click Properties (when
interaction_type = token_click)token_symboltoken_addresstoken_namechain_idpositionprice_usdprice_change_pcttime_filtersort_optionnetwork_filteris_search_resultSearch Properties (when
interaction_type = search)search_queryresults_counthas_resultstime_filtersort_optionnetwork_filterFilter Change Properties (when
interaction_type = filter_change)filter_typeprevious_valuenew_valuetime_filtersort_optionnetwork_filterChangelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Uploading Screen Recording 2026-01-29 at 17.35.57.mov…
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Medium risk because it changes tab-switching behavior via a new
onLeavehook and adds new analytics side effects (session start/end, search debounce) across multiple Trending entry points, which could impact navigation timing and event volume.Overview
Expands Trending analytics from session-only to interaction-level tracking.
TrendingFeedSessionManagernow emitsTRENDING_FEED_VIEWEDevents with aninteraction_typediscriminator (start/end, token_click, search, filter_change) and exposes new tracking helpers.Trending UI now propagates a
TrendingFilterContextthroughTrendingTokensList/TrendingTokenRowItemto record token click position, pricing, and active filters, adds a debounceduseSearchTrackinghook for search events (used in both the full Trending tokens view and Explore search), and tracks filter changes when time/sort/network selections change.Navigation updates add a tab-level
onLeavecallback and invoke it on tab switches; the Trending tab uses this to start sessions on press and end sessions when leaving the tab.Written by Cursor Bugbot for commit dbfeda0. This will update automatically on new commits. Configure here.