Skip to content

feat: add unified consent-gated editor telemetry#2885

Open
Soare-Robert-Daniel wants to merge 2 commits into
developmentfrom
dev/tracking
Open

feat: add unified consent-gated editor telemetry#2885
Soare-Robert-Daniel wants to merge 2 commits into
developmentfrom
dev/tracking

Conversation

@Soare-Robert-Daniel

Copy link
Copy Markdown
Contributor

Summary

  • Loads a single editor-telemetry webpack chunk when tracking consent is enabled, replacing the old static data-logging entry and split dynamic imports.
  • Adds four focused modules: block-health (invalid/missing blocks), block-usage (add/remove deltas), inventory (post-save otter_blocks_logger_data), and activation funnel (first insert + first save with depth bucket).
  • Bootstraps telemetry state from PHP-localized themeisleGutenberg.telemetry (logger data + first-save flag) instead of a REST fetch on editor load; registers otter_activation_first_save for per-site dedup.
  • Adds Playwright coverage for chunk consent gating, activation funnel, block-usage, inventory, and block-health.

Supersedes the editor-side pieces of #2864 (block-health) and #2866 (activation funnel) with a simpler, single-chunk architecture.

Test plan

  • npm run test:e2e:playwright -- src/blocks/test/e2e/blocks/block-telemetry.spec.js (7 tests)
  • Enable tracking consent in dashboard → confirm chunk-editor-telemetry.js loads in editor
  • Insert an Otter block → verify activation first-insert event fires once per session
  • Save a post with Otter blocks → verify first-save + depth bucket events
  • Add/remove blocks → verify block-usage deltas
  • Publish a post → verify otter_blocks_logger_data option updates
  • Insert invalid block markup → verify block-health event fires once per slug per session

Made with Cursor

Load a single editor-telemetry chunk when tracking is enabled, covering
block-health, block-usage, post-save inventory, and activation funnel
(first insert + first save with depth bucket). Bootstrap state comes from
PHP-localized themeisleGutenberg.telemetry instead of a REST fetch on load.

Register otter_activation_first_save for per-site dedup and expand e2e
coverage for chunk consent, activation, block-usage, inventory, and health.

Co-authored-by: Cursor <cursoragent@cursor.com>
@pirate-bot pirate-bot added the pr-checklist-incomplete The Pull Request checklist is incomplete. (automatic label) label Jun 30, 2026
@pirate-bot

pirate-bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Diff

Package Old Size New Size Diff
Animations 178.27 KB 178.27 KB 0 B (0.00%)
Blocks 1.53 MB 1.53 MB 1.91 KB (0.12%)
CSS 7.87 KB 7.87 KB 0 B (0.00%)
Dashboard 111.06 KB 111.06 KB 0 B (0.00%)
Onboarding 68.14 KB 68.14 KB 0 B (0.00%)
Export Import 4.7 KB 4.7 KB 0 B (0.00%)
Pro 436.32 KB 436.32 KB 0 B (0.00%)

@pirate-bot

pirate-bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Plugin build for 7fcfd89 is ready 🛎️!

@Soare-Robert-Daniel Soare-Robert-Daniel added the pr-checklist-skip Allow this Pull Request to skip checklist. label Jun 30, 2026
@Soare-Robert-Daniel Soare-Robert-Daniel self-assigned this Jun 30, 2026
@pirate-bot pirate-bot added pr-checklist-complete The Pull Request checklist is complete. (automatic label) and removed pr-checklist-incomplete The Pull Request checklist is incomplete. (automatic label) labels Jun 30, 2026
@pirate-bot

pirate-bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

E2E Tests

Playwright Test Status: See serial and parallel matrix jobs

Performance Results serverResponse: {"q25":482,"q50":492.05,"q75":525.4,"cnt":10}, firstPaint: {"q25":1333.1,"q50":1428.65,"q75":1498.3,"cnt":10}, domContentLoaded: {"q25":3656.8,"q50":3743.5,"q75":3766.1,"cnt":10}, loaded: {"q25":3658.6,"q50":3745.35,"q75":3768.3,"cnt":10}, firstContentfulPaint: {"q25":4222.3,"q50":4275.9,"q75":4317.4,"cnt":10}, firstBlock: {"q25":15266.4,"q50":15348.35,"q75":15390.8,"cnt":10}, type: {"q25":25.86,"q50":27.68,"q75":29.94,"cnt":10}, typeWithoutInspector: {"q25":26.27,"q50":26.62,"q75":27.95,"cnt":10}, typeWithTopToolbar: {"q25":36.13,"q50":37.76,"q75":38.79,"cnt":10}, typeContainer: {"q25":17.29,"q50":19.24,"q75":21.39,"cnt":10}, focus: {"q25":142.89,"q50":145.85,"q75":156.5,"cnt":10}, inserterOpen: {"q25":45.16,"q50":48.92,"q75":51.02,"cnt":10}, inserterSearch: {"q25":18.54,"q50":20.4,"q75":21.73,"cnt":10}, inserterHover: {"q25":5.52,"q50":5.71,"q75":6.22,"cnt":20}, loadPatterns: {"q25":1811.17,"q50":1841.91,"q75":1878.75,"cnt":10}, listViewOpen: {"q25":263.9,"q50":270.46,"q75":283.77,"cnt":10}

@abaicus

abaicus commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

A note that this should also address #2865 after #2860 is merged.

@abaicus

abaicus commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@Soare-Robert-Daniel now that we've merged the PR into dev, we can add the telemetry mentioned.

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

Labels

pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants