Skip to content

[Woo POS][Product Search] Analytics #13992

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

Draft
wants to merge 14 commits into
base: trunk
Choose a base branch
from

Conversation

samiuelson
Copy link
Contributor

@samiuelson samiuelson commented Apr 30, 2025

Closes: WOOPRD-465

Description

Specs

This PR adds tracking for the following events:

  • Log search_button_tapped with item_list_type parameter: products
  • Update item_added_to_cart to add source parameter: list | search_result
  • Add pre_search_recent_term_tapped event, with item_list_type parameter: products
  • Add items_next_page_loaded event with item_list_type and search: bool parameters

Steps to reproduce

N/A

Testing information

Verify in logcat that the above events are tracked.

The tests that have been performed

Verified that the events are tracked.

Images/gif

  • 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.

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on big (tablet) and small (phone) in case of UI changes, and no regressions are added.

@dangermattic
Copy link
Collaborator

1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Apr 30, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit297c0e8
Direct Downloadwoocommerce-wear-prototype-build-pr13992-297c0e8.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Apr 30, 2025

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

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit297c0e8
Direct Downloadwoocommerce-prototype-build-pr13992-297c0e8.apk

@codecov-commenter
Copy link

codecov-commenter commented May 2, 2025

Codecov Report

Attention: Patch coverage is 91.39785% with 8 lines in your changes missing coverage. Please review.

Project coverage is 38.32%. Comparing base (44f7e1d) to head (297c0e8).

Files with missing lines Patch % Lines
...oopos/home/items/coupons/WooPosCouponsViewModel.kt 0.00% 3 Missing ⚠️
...home/items/variations/WooPosVariationsViewModel.kt 85.71% 0 Missing and 2 partials ⚠️
...erce/android/ui/woopos/home/WooPosHomeViewModel.kt 0.00% 1 Missing ⚠️
...os/home/items/search/WooPosItemsSearchViewModel.kt 95.65% 0 Missing and 1 partial ⚠️
...d/ui/woopos/util/analytics/WooPosAnalyticsEvent.kt 94.11% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #13992      +/-   ##
============================================
+ Coverage     38.29%   38.32%   +0.03%     
- Complexity     9496     9500       +4     
============================================
  Files          2118     2118              
  Lines        116434   116512      +78     
  Branches      14937    14940       +3     
============================================
+ Hits          44583    44657      +74     
- Misses        67774    67775       +1     
- Partials       4077     4080       +3     

☔ 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.

@samiuelson samiuelson added this to the 22.4 milestone May 2, 2025
.map { it is SearchState.Visible && it.state is WooPosSearchInputState.Open }
.distinctUntilChanged()
.filter { it }
.onEach {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

onEach is invoked only when WooPosSearchInputState changes from Closed to Open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants