Skip to content

Log pathway search, click, and hover analytics to Mixpanel (SCP-5989) #2249

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

Merged
merged 4 commits into from
May 7, 2025

Conversation

eweitz
Copy link
Member

@eweitz eweitz commented May 6, 2025

This tracks user interactions with new pathway exploration features introduced in #2206. It helps assess usage.

Previously, queries from the main search box in Study Overview were all logged as "gene" searches. Interactions with the pathway diagram were also unlogged. We had very little observability on user engagement for this significant new feature.

Now, if a user clicks on one of the new pathway suggestions in the search autocomplete, then the search is logged as a "pathway" search. Hover / mouseover on gene nodes in the pathway diagram, and click on pathway nodes, are also now logged.

Test

A new automated test verifies some new logging. To optionally manually test:

  1. Go to "Cellular and transcriptional diversity over the course of human lactation" study
  2. Open Network panel in Chrom DevTools, filter to "event method:POST"
  3. In search box, type "lac"
  4. Select first pathway suggestion
  5. Confirm an event request is posted to Mixpanel with name "search" and type "pathway"
  6. Hover over a gene node in the pathway diagram
  7. Confirm event request with name "pathway-node-tooltip"
  8. Click on a green pathway node
  9. Confirm event request with name "pathway-node-click"

This satisfies SCP-5989.

@eweitz eweitz requested a review from bistline May 6, 2025 17:26
Copy link

codecov bot commented May 6, 2025

Codecov Report

Attention: Patch coverage is 44.44444% with 5 lines in your changes missing coverage. Please review.

Project coverage is 71.12%. Comparing base (def2112) to head (c75047a).

Files with missing lines Patch % Lines
...pp/javascript/components/visualization/Pathway.jsx 0.00% 5 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                  Coverage Diff                   @@
##           ew-refine-pathways    #2249      +/-   ##
======================================================
- Coverage               71.13%   71.12%   -0.01%     
======================================================
  Files                     335      335              
  Lines                   28671    28680       +9     
  Branches                 2522     2523       +1     
======================================================
+ Hits                    20395    20399       +4     
- Misses                   8134     8139       +5     
  Partials                  142      142              
Files with missing lines Coverage Δ
app/javascript/lib/search-metrics.js 63.38% <100.00%> (+1.06%) ⬆️
...pp/javascript/components/visualization/Pathway.jsx 64.36% <0.00%> (-3.93%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from ew-refine-pathways to development May 7, 2025 13:47
@eweitz eweitz merged commit 4edfa8f into development May 7, 2025
5 checks passed
@github-actions github-actions bot deleted the ew-pathway-analytics branch May 7, 2025 13:50
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.

2 participants