Skip to content

[WOOMOB-2073] Add analytics tracking for POS FTS search. Removes FF#15484

Merged
kidinov merged 9 commits intotrunkfrom
woomob-2073-woo-posfts-add-analytics-tracking-for-search
Mar 11, 2026
Merged

[WOOMOB-2073] Add analytics tracking for POS FTS search. Removes FF#15484
kidinov merged 9 commits intotrunkfrom
woomob-2073-woo-posfts-add-analytics-tracking-for-search

Conversation

@kidinov
Copy link
Copy Markdown
Contributor

@kidinov kidinov commented Mar 5, 2026

Description

Fixes WOOMOB-2073

Adds analytics tracking for POS Full-Text Search to measure search performance, ranking quality, and indexing overhead. This PR also includes the full FTS stack from parent branches (search implementation with relevance ranking, UI wiring with variation support) and removes the POS_PRODUCTS_FTS feature flag to make FTS always-on.

Analytics events added (as agreed in the P2 post):

  • search_results_fetched — tracks local FTS search latency, result count, and search method
  • fts_index_built — tracks FTS index build duration and size during sync (Android only)
  • pos_search_result_tapped — tracks result position and type (product/variation) for search quality measurement

Other changes:

  • Removed FeatureFlag.POS_PRODUCTS_FTS and IsPosProductsFtsEnabled — FTS is now the only search path
  • Removed LIKE search fallback code and related tests
  • Search hint updated to always show "Search products and variations"

Test Steps

  1. Open POS, go to the product list
  2. Tap search and type a product name — verify results appear quickly
  3. Tap a search result — verify it adds to cart
  4. Check Tracks for search_results_fetched with search_method: fts
  5. Check Tracks for pos_search_result_tapped with correct result_position
  6. Force a full sync — check Tracks for fts_index_built with sync_type: full

Images/gif

N/A

  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@kidinov kidinov added type: enhancement A request for an enhancement. feature: point of sale POS project category: tracks Related to analytics, including Tracks Events. status: do not merge Dependent on another PR, ready for review but not ready for merge. labels Mar 5, 2026
@kidinov kidinov changed the title [WOOMOB-2073] Add analytics tracking for POS FTS search [WOOMOB-2073] Add analytics tracking for POS FTS search. Removes FF Mar 5, 2026
@kidinov kidinov added this to the 24.4 milestone Mar 5, 2026
@wpmobilebot
Copy link
Copy Markdown
Collaborator

wpmobilebot commented Mar 5, 2026

App Icon📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App NameWooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Build Number734
Version24.3-rc-3
Application IDcom.woocommerce.android.prealpha
Commit2f3a9ed
Installation URL7jm7433v3tpdg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 48.27586% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.55%. Comparing base (ecb8a65) to head (2f3a9ed).
⚠️ Report is 340 commits behind head on trunk.

Files with missing lines Patch % Lines
...d/ui/woopos/util/analytics/WooPosAnalyticsEvent.kt 0.00% 36 Missing ⚠️
...i/woopos/localcatalog/WooPosFileBasedSyncAction.kt 46.66% 6 Missing and 2 partials ⚠️
...os/home/items/products/WooPosProductsDataSource.kt 40.00% 5 Missing and 1 partial ⚠️
...android/ui/woopos/localcatalog/WooPosSyncAction.kt 33.33% 5 Missing and 1 partial ⚠️
...os/home/items/search/WooPosItemsSearchViewModel.kt 88.23% 0 Missing and 2 partials ⚠️
...items/search/WooPosProductsSearchInDbDataSource.kt 84.61% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #15484      +/-   ##
============================================
- Coverage     39.55%   39.55%   -0.01%     
+ Complexity    11235    11233       -2     
============================================
  Files          2252     2251       -1     
  Lines        129662   129723      +61     
  Branches      18165    18163       -2     
============================================
+ Hits          51290    51306      +16     
- Misses        73134    73180      +46     
+ Partials       5238     5237       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kidinov kidinov requested a review from samiuelson March 5, 2026 13:27
@kidinov kidinov marked this pull request as ready for review March 5, 2026 13:30
Copy link
Copy Markdown
Contributor

@samiuelson samiuelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

kidinov added 9 commits March 10, 2026 11:30
DbSearchResult now carries searchTimeMillis and searchMethod through
SearchProductsResult.Local. FtsSyncResult returns duration and count
from FTS sync operations for downstream tracking.
Add SearchResultsFetched, FtsIndexBuilt, and SearchResultTapped events.
Track FTS index build duration and product count in both full and
incremental sync paths.
Track search performance (time, count, method) when local search
returns results. Track position and type when a search result is tapped.
FTS search is now the only search path for POS products.
Removed IsPosProductsFtsEnabled class, the LIKE search fallback,
and all related feature flag guards and tests.
@kidinov kidinov force-pushed the woomob-2073-woo-posfts-add-analytics-tracking-for-search branch from 7afedd2 to 2f3a9ed Compare March 10, 2026 10:31
@kidinov kidinov removed the status: do not merge Dependent on another PR, ready for review but not ready for merge. label Mar 11, 2026
@kidinov kidinov merged commit e7491b8 into trunk Mar 11, 2026
17 checks passed
@kidinov kidinov deleted the woomob-2073-woo-posfts-add-analytics-tracking-for-search branch March 11, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: tracks Related to analytics, including Tracks Events. feature: point of sale POS project type: enhancement A request for an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants