Skip to content

Track experimental feature toggles with analytics#22720

Open
nbradbury wants to merge 3 commits intotrunkfrom
feature/CMM-1971-track-experimental-features
Open

Track experimental feature toggles with analytics#22720
nbradbury wants to merge 3 commits intotrunkfrom
feature/CMM-1971-track-experimental-features

Conversation

@nbradbury
Copy link
Contributor

@nbradbury nbradbury commented Mar 20, 2026

Description

Closes CMM-1971

Adds analytics tracking when a user enables or disables an experimental feature. A single EXPERIMENTAL_FEATURE_TOGGLED event is fired from the setFeatureSwitchState() choke point with two properties:

  • feature — the feature's prefKey (e.g., "new_stats", "rs_post_list")
  • enabled — boolean indicating the new state

Also adds a debug log line for the toggle action.

Testing instructions

Verify analytics event fires on toggle:

  1. Open Me → Experimental Features
  2. Toggle any feature on
  • Verify EXPERIMENTAL_FEATURE_TOGGLED event is tracked with enabled=true and the correct feature key
  1. Toggle the same feature off
  • Verify EXPERIMENTAL_FEATURE_TOGGLED event is tracked with enabled=false and the correct feature key

nbradbury and others added 3 commits March 20, 2026 05:51
Add EXPERIMENTAL_FEATURE_TOGGLED event fired from setFeatureSwitchState()
with "feature" (prefKey) and "enabled" (boolean) properties.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dangermattic
Copy link
Collaborator

dangermattic commented Mar 20, 2026

1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@sonarqubecloud
Copy link

@wpmobilebot
Copy link
Contributor

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

App NameWordPress Android
Build TypeDebug
Versionpr22720-490f1f6
Build Number1488
Application IDorg.wordpress.android.prealpha
Commit490f1f6
Installation URL4f6vj6h8igfko
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

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

App NameJetpack Android
Build TypeDebug
Versionpr22720-490f1f6
Build Number1488
Application IDcom.jetpack.android.prealpha
Commit490f1f6
Installation URL12pvf5tfbm868
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.50%. Comparing base (f22f2d3) to head (490f1f6).

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #22720   +/-   ##
=======================================
  Coverage   37.50%   37.50%           
=======================================
  Files        2287     2287           
  Lines      120724   120731    +7     
  Branches    16537    16537           
=======================================
+ Hits        45275    45282    +7     
  Misses      71774    71774           
  Partials     3675     3675           

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nbradbury nbradbury marked this pull request as ready for review March 20, 2026 10:43
@nbradbury nbradbury requested review from adalpari and dcalhoun and removed request for adalpari March 20, 2026 10:44
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.

3 participants