Page MenuHomePhabricator

Instrument the Page Visit health metric for PersonalDashboard extension
Closed, ResolvedPublic5 Estimated Story Points

Description

We want to get baseline product health metrics on our PersonalDashboard extension.
In order to get this, we will follow the xLab measure product health workflow.

The event that we would like to instrument is:

  • Page visit per 2 week increment (Note, this can probably just be an individual page visit metric that we will then sum/analyze over time for simplicity.)
  • Click through rate on the Dashboard link in the menu

Acceptance Criteria:

  • Use xLab SDKs to instrument the above event
  • Ensure the event is being sent correctly
  • Create ticket to create Superset dashboard from data platform engineering (this may be more of a conversation) T412137

Details

Event Timeline

Kgraessle renamed this task from Instrument PersonalDashboard extension to Instrument the Page Visit health metric for PersonalDashboard extension.Oct 28 2025, 4:08 PM
Kgraessle set the point value for this task to 5.
Kgraessle moved this task from To be estimated to Estimated on the Moderator-Tools-Team board.
Dillon changed the task status from Open to Stalled.Oct 30 2025, 5:13 PM
Samwalton9-WMF changed the task status from Stalled to Open.Nov 12 2025, 3:11 PM
Dillon lowered the priority of this task from High to Medium.Nov 13 2025, 5:41 PM
jsn.sherman changed the task status from Open to In Progress.Nov 17 2025, 7:32 PM
jsn.sherman claimed this task.
jsn.sherman moved this task from Ready to In Progress on the Moderator-Tools-Team (Kanban) board.
Samwalton9-WMF changed the task status from In Progress to Open.Nov 25 2025, 4:07 PM
Samwalton9-WMF removed jsn.sherman as the assignee of this task.
Samwalton9-WMF moved this task from In Progress to Ready on the Moderator-Tools-Team (Kanban) board.
Samwalton9-WMF added a subscriber: jsn.sherman.
Kgraessle removed Kgraessle as the assignee of this task.
Kgraessle moved this task from Ready to In Progress on the Moderator-Tools-Team (Kanban) board.
Kgraessle moved this task from In Progress to Ready on the Moderator-Tools-Team (Kanban) board.

Change #1223193 had a related patch set uploaded (by Kgraessle; author: Kgraessle):

[mediawiki/extensions/PersonalDashboard@master] Instrument the Page Visit health metric for PersonalDashboard extension

https://gerrit.wikimedia.org/r/1223193

Change #1223201 had a related patch set uploaded (by Kgraessle; author: Kgraessle):

[mediawiki/extensions/WikimediaEvents@master] Instrument the Page Visit health metric for PersonalDashboard extension

https://gerrit.wikimedia.org/r/1223201

Kgraessle changed the task status from Open to Stalled.Jan 5 2026, 3:15 PM
Kgraessle changed the task status from Stalled to Open.Jan 9 2026, 6:03 PM

This isn't ready to be merged yet, but can be tested and reviewed on the engineering side.

Kgraessle changed the task status from Open to Stalled.Jan 26 2026, 3:42 PM
Kgraessle added a subscriber: phuedx.

@phuedx

This is the ticket we're currently stalled on with the stream configuration fetching.

Ok, I rolled up both T407275: Instrument Recent Activity Module and T407280: Instrument Content Policy module and Impact Module into the same two patches as this ticket since the changes were not large.

Note I have stalled out all of the instrumentation tickets until we're able to merge the following fix in https://phabricator.wikimedia.org/T414174. Though we should be able to test locally and do engineering review in the meantime.
I also need to fix one issue with a unit test and the extension registry, but will talk about this in engineering weekly.

Note you can run the following command to get around the config fetching issue locally:

docker compose exec mediawiki maintenance/run.php ./extensions/TestKitchen/maintenance/UpdateConfigs.php
Samwalton9-WMF raised the priority of this task from Medium to High.Feb 3 2026, 4:09 PM

I also need to fix one issue with a unit test and the extension registry, but will talk about this in engineering weekly.

Noting that this issue is fixed and we are now waiting on the patch on T414174: Automatically fetch instrument configs in local dev environment to be merged.

Change #1223201 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Instrument health metrics for PersonalDashboard extension

https://gerrit.wikimedia.org/r/1223201

Change #1223193 merged by jenkins-bot:

[mediawiki/extensions/PersonalDashboard@master] Instrument health metrics for PersonalDashboard extension

https://gerrit.wikimedia.org/r/1223193

Dillon changed the task status from Stalled to In Progress.Feb 5 2026, 5:36 PM

verified dashboard link tracking on stathost notebook:

import wmfdata as wmf
query='select count(*) from event.product_metrics_web_base where element_friendly_name = "Personal Dashboard menu link";'
result = wmf.spark.run(query)
result

We haven't figured out how to query page views by instrument name, so we can't validate that part through a stat host ATM.

Query for page views:

wmf.spark.run("""
SELECT * FROM event.product_metrics_web_base WHERE instrument_name='personal-dashboard-health-metrics' AND action ='pageview' AND month=2 AND day=19 AND year=2026 LIMIT 3;
"""

@Kgraessle - I'm currently seeing many users where we log impressions and clicks (action IN ('click', 'impression')) but not a pageview (action = 'pageview'). See query below.

Do you know why these instances would occur?

SELECT
      performer.name AS user_name,
      SUM(IF(action = 'pageview', 1, 0)) AS pv_count,
      SUM(IF(action = 'impression', 1, 0)) AS imp_count,
      SUM(IF(action = 'click', 1, 0)) AS click_count
  FROM event.product_metrics_web_base 
  WHERE 
      instrument_name = 'personal-dashboard-health-metrics'
      AND YEAR = 2026
      AND MONTh = 02
      AND DAY >= 19
  GROUP BY 1

@Kgraessle - I'm currently seeing many users where we log impressions and clicks (action IN ('click', 'impression')) but not a pageview (action = 'pageview'). See query below.

Do you know why these instances would occur?

SELECT
      performer.name AS user_name,
      SUM(IF(action = 'pageview', 1, 0)) AS pv_count,
      SUM(IF(action = 'impression', 1, 0)) AS imp_count,
      SUM(IF(action = 'click', 1, 0)) AS click_count
  FROM event.product_metrics_web_base 
  WHERE 
      instrument_name = 'personal-dashboard-health-metrics'
      AND YEAR = 2026
      AND MONTh = 02
      AND DAY >= 19
  GROUP BY 1

Hi! @MNeisler
It looks like that query is capturing all impressions and because we have an impression on each page with the navigation menu link you'll get a lot.
I modified your query slightly to filter out events with that element_friendly_name of "Personal Dashboard menu link" and the numbers look about right.

SELECT
      performer.name AS user_name,
      SUM(IF(action = 'pageview', 1, 0)) AS pv_count,
      SUM(IF(action = 'impression', 1, 0)) AS imp_count,
      SUM(IF(action = 'click', 1, 0)) AS click_count
  FROM event.product_metrics_web_base 
  WHERE 
      instrument_name = 'personal-dashboard-health-metrics'
      AND YEAR = 2026
      AND MONTh = 02
      AND DAY >= 19
      AND (
          element_friendly_name IS NULL
          OR element_friendly_name NOT LIKE '%Personal Dashboard menu link%'
        )
  GROUP BY 1

Let me know if you have any other questions.

Got it. The pageview numbers look correct with that additional filter. Thanks for clarifying!