Readers Web will be A/B testing the existing treatment of the language switcher and a new treatment being worked on as part of Desktop Improvements (Vector 2022).
Per T268504, we'd like to understand how long the user was reading the page before changing language via the Universal Language Switcher (the ULS) and how the new treatment impacts that vs the existing treatment.
AC
- When I change language using the ULS, then I see an UniversalLanguageSwitcher event being logged
- The event's timeToChangeLanguage property is set to the number of milliseconds that the page was visible after the instrumentation started to execute (see T268504#6803654 and https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikimediaEvents/+/551259 for detail)
Developer Notes
// Stephane Bisson's implementation in WikimediaEvents/ext.wikimediaEvents/InukaPageView.js (see // https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikimediaEvents/+/551259), which I believe // was based on Readers Web's implementation in the ReadingDepth instrument. var start = mw.now(), hiddenAt = null, timeHidden = 0; function onHide() { if ( !hiddenAt ) { hiddenAt = mw.now(); } } function onShow() { if ( hiddenAt ) { timeHidden += mw.now() - hiddenAt; hiddenAt = null; } } if ( document.hidden ) { onHide(); } document.addEventListener( 'visibilitychange', () => { if ( document.hidden ) { onHide(); } else { onShow(); } } ); function getTimeSinceLoaded() { return mw.now() - timePaused; } function interfaceLanguageChange( language ) { log( { /* ... */ timeOnPage: getTimeOnPage() } ); }
QA Results - Beta
AC | Status | Details |
---|---|---|
1 | ✅ | T275794#6994278 |
QA Results - Prod
AC | Status | Details |
---|---|---|
1 | ✅ | T275794#7001347 |