Based on our instrumentation need for the ToC AB test, as outlined in this Google doc
https://docs.google.com/spreadsheets/d/1CAXGqV2JR_bE0ulo9EU3I74Jm0Ln9z1u2CjC6zvra7I/edit#gid=0
We want to measure how often people scroll past the table of contents to read an article, then scroll back to the table of contents to click on a heading and navigate the article that way.
In order to measure this, we need to
- update the mediawiki_web_ui_scroll schema to accept a new "action" value, scroll-to-toc.
- Update the webUIScroll.js instrumentation to fire a new event when the table of contents is scrolled past and scrolled to (based on whether its entering the viewport from the top or the bottom).
QA steps
- To see event logging for the new scroll-to-toc event in a local environment, make sure you have the updated scroll schema installed (web_ui_scroll v1.0.1 in your local secondary repo) along with patches https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikimediaEvents/+/773628 and https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/773632 if they have not yet been merged (or latest upstream of Vector + WME repos if merged).
- Add the following config in your local settings:
$wgWMEWebUIScrollTrackingSamplingRate = 1; $wgWMEWebUIScrollTrackingSamplingRateAnons = 1;
- Navigate to a page in modern Vector with the legacy TOC in the main content (page can be populated by content provider).
- as a logged-in user i.e. http://localhost:8080/wiki/Husky
- as anon i.e. http://localhost:8080/wiki/Husky?useskin=vector-2022
- Navigate to a page in modern Vector without the legacy TOC in the main content - i.e. append ?tableofcontent=1 querystring to local url (note that in a local dev environment, testing on page populated by content provider will not generate the new sticky TOC with the query param -- you need to have a locally created page with sections and headings - T299065 ticket description has sample html to render the sticky sidebar TOC).
- as a logged-in user i.e. http://localhost:8080/wiki/<locally-created-page>?tableofcontents=1
- as anon i.e. http://localhost:8080/wiki/<locally-created-page>?useskin=vector-2022&tableofcontents=1
- The new scroll-to-toc event gets triggered by the following actions:
- scroll down past either the rendered legacy TOC in the main content or the legacy TOC placeholder tag (present in the markup with TOC query param) in the main content
- wait 5 seconds
- then scroll back up past the bottom of the rendered legacy TOC or the legacy TOC placeholder.
- note in your local eventlogging stream that a new scroll-to-toc action is submitted against the /analytics/mediawiki/web_ui_scroll/1.0.1 schema
QA Results - Prod
AC | Status | Details |
---|---|---|
1 | ✅ | T303297#7981809 |
2 | ✅ | T303297#7981809 |
3 | ✅ | T303297#7981809 |