Page MenuHomePhabricator

ReadingList JS instrumentation spike
Closed, ResolvedPublic2 Estimated Story PointsSpike

Description

Proof of concept that shows what instrumentation would look for a single click event and page load event

User story

  • As an Engineer on the REx team, I want to know how instrumentation for click and page load events works within the new metrics platform

Requirements

Screenshot 2025-08-19 at 1.15.13 PM.png (708×652 px, 379 KB)

Whenever someone clicks the bookmark icon, we want to log a click event containing.

User flow

  1. A user is bucketed into the experiment
  2. An eventLogging page_load event is logged whenever they visit a page
  3. They save or remove an article
  4. An eventLogging click event is logged

Event Timeline

SToyofuku-WMF moved this task from Incoming to Ready for sprint on the Reader Experience Team board.
SToyofuku-WMF set the point value for this task to 2.

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

[mediawiki/extensions/WikimediaEvents@master] POC Instrument ClickThroughRate and page load

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

LMora-WMF renamed this task from Placeholder for JS instrumentation spike to ReadingList JS instrumentation spike .Aug 29 2025, 5:59 PM
LMora-WMF updated the task description. (Show Details)

Got a working POC patch up, here's some of the event info I am seeing:

{
    "action": "page_visited",
    "action_source": "page_load",
    "action_context": "/wiki/Main_Page",
    "experiment": {
        "enrolled": "we-3-3-4-reading-list-test1",
        "assigned": "treatment",
        "subject_id": "awaiting",
        "sampling_unit": "edge-unique",
        "coordinator": "xLab"
    },
    "$schema": "/analytics/product_metrics/web/base/1.4.2",
    "mediawiki": {
        "database": "my_wiki",
        "skin": "vector-2022"
    },
    "page": {
        "id": 15580374,
        "title": "Main Page",
        "namespace_id": 0,
        "content_language": "en"
    },
}

and similar for impression and click

{
    "action": "click",
    "instrument_name": "ClickThroughRateInstrument",
    "funnel_entry_token": "xxxxxxxxx",
    "element_friendly_name": "Save to Reading List",
    "experiment": {
        "enrolled": "we-3-3-4-reading-list-test1",
        "assigned": "treatment",
        "subject_id": "awaiting",
        "sampling_unit": "edge-unique",
        "coordinator": "xLab"
    },
}

In addition to celebrating the quick turnaround ^ I can also certify that this looks reasonable, makes sense, and unblocks us from implementing JS instrumentation - thanks @LMora-WMF!!

The POC looks good, it looks like we'll be able to use the CTR (click through rate) instrument for all the usage metrics we need for this experiment, and pageload event looks good too.

Restricted Application changed the subtype of this task from "Task" to "Spike". · View Herald TranscriptSep 12 2025, 8:08 PM

Change #1182650 abandoned by LorenMora:

[mediawiki/extensions/WikimediaEvents@master] POC Instrument ClickThroughRate and page load

Reason:

was just for poc

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