Skip to content

Instrument connection, sync, settings, media, cache, features, and deactivation analytics events - #1226

Draft
gabrielcld2 wants to merge 8 commits into
developfrom
feature/custom-events-tracking
Draft

Instrument connection, sync, settings, media, cache, features, and deactivation analytics events#1226
gabrielcld2 wants to merge 8 commits into
developfrom
feature/custom-events-tracking

Conversation

@gabrielcld2

Copy link
Copy Markdown
Collaborator

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_started only covers the manual REST trigger (Push_Sync::rest_start_sync()). The auto_restart case inside Sync_Queue::stop_maybe() is treated as internal plumbing and isn't instrumented.
  • asset_sync_failed hooks the broad, already-generic Sync::log_sync_result() rather than the narrowerUpload_Sync::upload_asset(), trading a small asset_type lookup cost for covering every sync type in one place.
  • sync_completed needed new state (Sync_Queue::mark_run_started() / tally_run_result() / track_run_completed()) since no
    existing signal survives the queue's internal restart cycles.
  • account_switched is new comparison logic in Connect::verify_connection()Connect::switch_account() turned out to be dead code (no callers since 2021), not something to hook into.
  • Cache-category events target php/assets/class-rest-assets.php, not php/class-cache.php — the latter is never instantiated (dead code), confirmed via exploration before wiring anything.
  • gallery_configured's layout/media_count are parsed out of the gallery_config field's serialized JSON blob rather than being real submitted fields.

QA notes

  • Detail the steps needed to verify the PR.

gabriel-detassigny and others added 8 commits July 20, 2026 14:18
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.
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