The mobile web site has a button at the bottom of every page which takes users to the desktop version of the site.
The Moderator-Tools-Team would like to understand when and why this button is clicked, to help us prioritise features for improvement and measure the impact of our changes. We can do this to some extent by looking directly at web request data, but this only provides project- and IP-level data. We don't know anything about the user who clicked the link and it's hard to parse the page they were on.
We would like to be able to collect at least the following data when this toggle is clicked:
- Wikimedia project
- Page title
- Page namespace
- User edit count (can be bucketed; can be local or global)
- User groups
- User anonymous or logged-in
Questions
- How can we collect this data?
- We would need to create/generate a new json schema as noted here.
- Once we have a schema we will need to declare that schema in $wgEventStreams config value by editing
wmf-config/InitialiseSettings-labs.php / InitialiseSettings.php
- Write instrumentation code to use event logging
$( '#content' ).on( 'click', 'a.desktop_toggle, function ( jqEvent ) { var link = jqEvent.target; var event = { }; var streamName = 'mediawiki.interwiki_desktop_mobile_link'; mw.eventLog.submit( streamName, event ); } );
- UPDATE - there is an easier way of implementing event-logging as per a conversation with @phuedx -> the new Metrics Platform has simplified the process and removed the need to create yaml files for new streams. We will use this new method as it is currently in production. Please see new mono-yaml file with all the usual metric suspects here