As a system I would like to gather the following when a user clicks a link to toggle from mobile to desktop:
- Wikimedia project
- Page title
- Page namespace
- User edit count (can be bucketed; can be local or global)
- User groups
- User anonymous or logged-in
This data will be gathered using the approach noted in https://phabricator.wikimedia.org/T310045
===Developer Local Setup===
1. Register the metrics platform configuration stream:
```LocalSettings.php```
```$wgEventStreams = [
[
'stream' => 'desktop_mobile_link_clicks',
'schema_title' => '/analytics/mediawiki/client/metrics_event',
'destination_event_service' => 'eventgate-analytics-external',
// TODO: Determine whether this stream should be sampled
// 'sample' => [
// 'unit' => 'pageview',
// 'rate' => ...,
// ],
'producers' => [
'metrics_platform_client' => [
'events' => [
'mediawiki.desktop_link.click',
'mediawiki.change_credentials.click',
'mediawiki.change_email.click',
],
'provide_values' => [
'page_title',
'page_namespace',
'performer_edit_count_bucket',
'performer_groups',
'performer_is_logged_in',
],
],
],
],
];
```
2. Add the stream to the list of streams that the EventLogging extension knows about:
```LocalSettings.php```
``` $wgEventLoggingStreamNames[] = 'desktop_mobile_link_clicks';```
3. Checkout patch to MinervaNueu that has the click event
https://gerrit.wikimedia.org/r/c/mediawiki/skins/MinervaNeue/+/812009
4. Enter mobile browser mode and click on the Desktop footer link
{F35354882}
5. Observe the event triggered an event log message under event_logging in Docker console:
{F35354886}