Page MenuHomePhabricator

Reading Lists Instrumentation - view article click event
Closed, ResolvedPublic0 Estimated Story Points

Description

Background

With reference to the Instrumentation Spec and Parent Ticket, this task is for implementing a click event for when the user clicks on a link to an article from their reading list Special page.

Design requirements

Instrumentation Workflow Reading List (1).jpg (540×960 px, 55 KB)

Requirements

Implement the following instrumentation events:

  • Views of an article from the reading list - User clicks on an article link in the reading list
action: click
action_subtype: view_article
action_source:reading_list
action_context={article_count: <INT>}

Requirement

Scope: Desktop web (Vector 2022) and mobile web (Minerva).

  • Implement a click instrumentation event for when a user clicks on an article link from their Reading List (Special:ReadingLists).
  • Event parameters:
    • action: click
    • action_subtype: view_article
    • action_source: reading_list
    • action_context: { article_count: <INT> }
  • The event must trigger each time the user clicks an article in the Reading List.
  • The event must include the correct contextual attributes defined in the instrumentation spec (e.g., page content language, skin, session ID, etc.).
  • No duplicate or missing events should occur on repeated clicks.

BDD

Feature: Instrumentation for clicking article links in Reading List

  Scenario: User clicks an article link from Reading List
    Given I am on the Special:ReadingLists page
    And I have one or more saved articles
    When I click on any article link in my Reading List
    Then an instrumentation event is logged with:
      | action          | click         |
      | action_subtype  | view_article  |
      | action_source   | reading_list  |
      | action_context  | {article_count: <INT>} |

Test Steps

Test Case 1: Verify view_article click event

  1. Log in as a user with saved articles in their Reading List.
  2. Open Special:ReadingLists.
  3. Open browser DevTools → Network tab → filter for eventlogging or instrumentation endpoint.
  4. Click on any article link in the Reading List.
  5. AC1: A click event is logged with action: click.
  6. AC2: The event contains action_subtype: view_article and action_source: reading_list.
  7. AC3: The event includes action_context: {article_count: <INT>} representing the number of saved articles.
  8. AC4: Only one event fires per click, with no duplicates.

QA Results - Prod

Event Timeline

LMora-WMF renamed this task from Reading Lists Instrumentation - to Reading Lists Instrumentation - view article click event.Sep 18 2025, 4:13 PM
aude triaged this task as High priority.Sep 22 2025, 7:47 PM
aude moved this task from Incoming to Needs refinement on the Reader Experience Team board.
LMora-WMF set the point value for this task to 2.Sep 23 2025, 2:59 PM

Change #1194727 had a related patch set uploaded (by LorenMora; author: LorenMora):

[mediawiki/extensions/WikimediaEvents@master] Track clicks on links to articles from readinglist special page

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

@Jdrewniak @SToyofuku-WMF @LMora-WMF Is this something that can be QA'd on the beta cluster? or do we need to wait for it to be on test.wikipedia (and can QA there)?

Change #1194727 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Track clicks on links to articles from readinglist special page

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

Change #1197664 had a related patch set uploaded (by LorenMora; author: LorenMora):

[mediawiki/extensions/WikimediaEvents@master] Use mw-ui-icon-bookmarkList class instead of treatment in conditional

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

HFan-WMF changed the point value for this task from 2 to 0.
HFan-WMF subscribed.

Moving to Sprint 8 for QA, and changing story points from original 2 to 0 to not impact the new sprint's point totals!

SToyofuku-WMF added a subscriber: Edtadros.

We're assuming this one can't be tested until T406930 as the library is currently commented out

Loren to uncomment out the library loading, then put back in code review for the second patch

Change #1197664 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Use mw-ui-icon-bookmarkList class instead of treatment in conditional

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

Jdrewniak claimed this task.

Test Result - Prod

Status: ❌ FAIL
Environment: testwiki
OS: macOS Tahoe 26.x
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: NA

Test Case 1: Verify view_article click event

  1. Log in as a user with saved articles in their Reading List.
  2. Open Special:ReadingLists.
  3. Open browser DevTools → Network tab → filter for eventlogging or instrumentation endpoint.
  4. Click on any article link in the Reading List.
  5. AC1: A click event is logged with action: click.
  6. AC2: The event contains action_subtype: view_article and action_source: reading_list.
  7. AC3: The event includes action_context: {article_count: <INT>} representing the number of saved articles.
  8. AC4: Only one event fires per click, with no duplicates.

No click events appeared in the Network tab on devtools.

Steph to verify why the heck this isn't working

From slack:

I forgot - the reason it wasn't working is because events logged through the experiments platform aren't actually sent if you override yourself into the experiment. They get put in the console. Using mw.xLab.overrideExperimentGroup( 'we-3-3-4-reading-list-test1', 'treatment' ) I was able to see the following in my console:

click {
  "action_subtype": "view_article",
  "action_source": "reading_list",
  "action_context": "{\"article_count\":6}"
}