Instrument connection, sync, settings, media, cache, features, and deactivation analytics events - #1226
Draft
gabrielcld2 wants to merge 8 commits into
Draft
Instrument connection, sync, settings, media, cache, features, and deactivation analytics events#1226gabrielcld2 wants to merge 8 commits into
gabrielcld2 wants to merge 8 commits into
Conversation
Develop to uat
Release process GH Action
…activation analytics events Wires the remaining 7 event categories from the analytics tracking spec on top of the existing WPP-1210 custom-events framework: connection management, asset sync, settings & navigation, media & asset actions, non-media cache, extensions & gallery, and deactivation. All call sites reuse Analytics::track() / Analytics.track() and were live-verified against wp-env via WP-CLI/REST dispatch. Adds a permanent e2e analytics-capture mu-plugin and two Playwright specs covering connection and deactivation events. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The previous commit only included src/js/* source changes. This repo ships compiled js/* output directly, so the extension_toggled, special_offer_clicked, deactivation_modal_viewed, and deactivation_skipped tracking calls weren't actually live until this rebuild. Live-verified via the full Playwright e2e suite against wp-env with real Cloudinary credentials (13/13 passing). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…nts-tracking # Conflicts: # php/class-admin.php # php/class-deactivation.php
develop bumped phpstan to level 5 after this branch was cut. The Analytics component (added in WPP-1210) was missing from get_component()'s @return union, so every ->track() call site read as "method.notFound" once merged. Re-verified clean at level 5 and against the full Playwright e2e suite.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Approach
Wires the remaining 7 event categories from the Analytics Event Tracking Spec POC's custom-events framework:
connection management, asset sync, settings & navigation, media & asset actions, non-media cache, extensions & gallery, and deactivation (30 events total).
No changes to the transport layer (
Analytics::track()/Analytics.track()) — this is call-site wiring only.Design decisions worth a second look
bulk_sync_startedonly covers the manual REST trigger (Push_Sync::rest_start_sync()). Theauto_restartcase insideSync_Queue::stop_maybe()is treated as internal plumbing and isn't instrumented.asset_sync_failedhooks the broad, already-genericSync::log_sync_result()rather than the narrowerUpload_Sync::upload_asset(), trading a smallasset_typelookup cost for covering every sync type in one place.sync_completedneeded new state (Sync_Queue::mark_run_started()/tally_run_result()/track_run_completed()) since noexisting signal survives the queue's internal restart cycles.
account_switchedis new comparison logic inConnect::verify_connection()—Connect::switch_account()turned out to be dead code (no callers since 2021), not something to hook into.php/assets/class-rest-assets.php, notphp/class-cache.php— the latter is never instantiated (dead code), confirmed via exploration before wiring anything.gallery_configured'slayout/media_countare parsed out of thegallery_configfield's serialized JSON blob rather than being real submitted fields.QA notes