Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Analytics] Add search query analytics tracking #1808

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

BrodyHughes
Copy link
Member

@BrodyHughes BrodyHughes commented Jan 17, 2025

Fixes BX-1695

Changes

Added new analytics event search_query to track user searches across different app surfaces
Implemented search tracking in three key areas:

  • Command+K search bar
  • Send token/NFT selection
  • Swap token selection

Implementation Details

Added new event type with properties:

  • location: Identifies where the search was initiated ('swap' | 'send' | 'commandk')
  • query: The actual search string
  • queryLength: Length of the search query

Search events are tracked when:

  1. User executes a command in Cmd+K after searching
  2. User selects a token/NFT in Send flow after searching
  3. User selects a token in Swap flow after searching

Added cleanup tracking in Cmd+K to ensure searches are captured even if user closes without selection

Testing

Verify that search analytics events are properly tracked:

  • Use Cmd+K and search for something
  • Try searching in the Send flow when selecting tokens/NFTs
  • Search for tokens in the Swap interface
  • Verify the events include correct location, query string, and query length

The changes align with the existing search tracking in the Rainbow mobile app, providing consistency in analytics across platforms.

POW

Screen.Recording.2025-01-24.at.2.35.35.PM.mov

Copy link

linear bot commented Jan 17, 2025

@BrodyHughes BrodyHughes changed the title debounce logging for search inputs [WIP] debounce logging for search inputs Jan 17, 2025
@BrodyHughes BrodyHughes self-assigned this Jan 24, 2025
@BrodyHughes BrodyHughes removed the request for review from DanielSinclair January 24, 2025 20:39
@BrodyHughes BrodyHughes changed the title [WIP] debounce logging for search inputs [Analytics] Add search query analytics tracking Jan 31, 2025
@BrodyHughes BrodyHughes marked this pull request as ready for review January 31, 2025 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant