feat(tile-usage-analytics): per-tile click analytics + archive - #9
Merged
Merged
Conversation
…shboard-view-analytics Adds an aggregate-only oc_launchpad_tile_clicks table, TileAnalyticsService, TileAnalyticsController, and a fire-and-forget frontend hook that records tile activations. Reuses the existing dashboard-view-analytics privacy machinery wholesale: the same salted-daily-hash unique-actor dedup (UniqueViewerDedup), the same analytics_enabled/analytics_optout gates (delegated to AnalyticsService), the same SaltRotationJob, and the existing PurgeViewsJob (extended to purge the new table in the same run). No per-event rows are ever persisted; no new opt-out surface is introduced. openspec/changes/tile-usage-analytics
to canonical spec; archive - Migration renumbered 002006->002007 (Date20260724) to avoid a class-name collision with admin-template-resync's Version002006Date20260723000000. - All 20 @SPEC tags retargeted from the change dir to the canonical openspec/specs/dashboard-view-analytics/spec.md — a change-dir target breaks the moment the change is archived. - Change archived. 29 phpunit tests / 47 assertions pass after the rename.
rubenvdlinde
requested review from
Rem-Dam,
SudoThijn,
WilcoLouwerse,
bbrands02,
remko48 and
rjzondervan
as code owners
July 23, 2026 22:49
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.
Implements and archives
tile-usage-analytics, extending the existingdashboard-view-analyticscapability rather than duplicating it.What
oc_launchpad_tile_clicksaggregate table (composite unique index on(placement_uuid, click_bucket)so repeat clicks increment in place). No per-event rows, ever.TileAnalyticsServicedelegates gating to the existingAnalyticsService::isGloballyEnabled()/isUserOptedOut()and dedup to the existingUniqueViewerDedup— no second opt-out setting, no second salt.POST /api/tile-click/{placementId}to record; admin-guarded top-tiles / per-dashboard / CSV endpoints.PurgeViewsJobwas extended to purge both tables in one run — no second job.Verification (local, no CI wait)
phpunit --filter 'TileAnalytics|PurgeViewsJob'→ OK (29 tests, 47 assertions); full suite 1335 tests, 3302 assertions OK.npx vitest run→ 45 files / 414 tests pass.analytics_enabledis false and for an opted-out user; repeat clicks by the same actor incrementclickCountbut notuniqueActorCount.Two defects I fixed before merging
admin-template-resyncboth generatedVersion002006Date20260723000000. Renumbered here toVersion002007Date20260724000000; tests re-run green after the rename.@spectargets — all 20 tags pointed at the change directory, which breaks the moment the change is archived. Retargeted to the canonicalopenspec/specs/dashboard-view-analytics/spec.md.Not done
No admin-UI page for the new reports (not required by tasks.md); no e2e; no live-DB migration test (no precedent for the sibling table either).