Page MenuHomePhabricator

Log additional click events on Special:Diff
Closed, ResolvedPublic5 Estimated Story Points

Assigned To
Authored By
Samwalton9-WMF
Jan 4 2023, 12:17 PM
Referenced Files
F36292989: image.png
Jan 18 2023, 10:50 AM
F36292986: image.png
Jan 18 2023, 10:50 AM
F36292982: image.png
Jan 18 2023, 10:50 AM
F36292975: image.png
Jan 18 2023, 10:50 AM
F35975644: image.png
Jan 4 2023, 12:17 PM
F35975642: image.png
Jan 4 2023, 12:17 PM
F35975634: image.png
Jan 4 2023, 12:17 PM
F35975631: image.png
Jan 4 2023, 12:17 PM

Description

We want to be able to log click events on actions and links of note in Special:Diff so that we can better understand user behaviour on the page and evaluate our changes. This task is limited in scope to Special:Diff (not the MobileFrontend Special:MobileDiff page) and the Vector and Vector 2022 skins.

Specs

Register click events to the following buttons via the Metrics Platform (highlighted) in the Vector and Vector 2022 skins. The screenshots below are from Vector 2022, but the locations of these links should be extremely similar in legacy Vector.

Undo

image.png (915×1 px, 108 KB)

Thank

image.png (915×1 px, 108 KB)

Rollback

Requires administrator rights, by default.

image.png (929×1 px, 122 KB)

Change visibility

Requires administrator rights, by default.

image.png (929×1 px, 121 KB)

View history

image.png (929×1 px, 121 KB)

Contribs

image.png (929×1 px, 121 KB)

Add to watchlist

image.png (929×1 px, 121 KB)

User page

image.png (682×1 px, 83 KB)

Previous/Next edit

image.png (740×1 px, 86 KB)

Tags

image.png (807×1 px, 130 KB)

Specific tag links

image.png (807×1 px, 130 KB)

Technical information

TBD

Testing and QA / Acceptance Criteria

  • Clicking the buttons highlighted in the Specs above should log an event via the Metrics Platform.

Event Timeline

One question I have - some of these links are in the headers for all pages, but we only care about data for users on the Diff page. Are we able to limit our logging to this case, or would adding tracking to those links necessarily log from everywhere that links like 'View history' are present?

One question I have - some of these links are in the headers for all pages, but we only care about data for users on the Diff page. Are we able to limit our logging to this case, or would adding tracking to those links necessarily log from everywhere that links like 'View history' are present?

@phuedx I wonder if you might have an answer to this, in the context of using the Metrics Platform?

Hey @Samwalton9. I think the simplest solution would be to create an instrument tailored to the page you want it to run on.

This could be implemented as simply as:

WikimediaEvents/modules/ext.wikimediaEvents/index.js
// …

// Added by DifferenceEngine::showDiffPage()
var isDiffPage = !!mw.config.get( 'wgDiffOldId' );

if ( isDiffPage ) {
  require( './specialDiff.js' );
}
WikimediaEvents/modules/ext.wikimediaEvents/specialDiff.js
// Insert awesome instrument here

This approach has a couple advantages over using something like the *WebUIActions instruments:

  1. You own the instrument: You can enable/disable/modify it when you need without coordination with other teams
  2. You can have a higher sample rate
    • The *WebUIActions instruments run on very nearly all pageviews and so have a low sampling rate. Your instrument will run on a much smaller subset of pageviews and so can have a higher sample rate

Change 895853 had a related patch set uploaded (by Jsn.sherman; author: Jsn.sherman):

[mediawiki/extensions/WikimediaEvents@master] WIP: Log additional click events on Special:Diff

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

@Samwalton9 I'm a little unclear on the "specific tag links" part. Is there a list of the tag links you want to track?

@Samwalton9 I'm a little unclear on the "specific tag links" part. Is there a list of the tag links you want to track?

I was hoping we could track any linked tags there generically. The second column at https://en.wikipedia.org/wiki/Special:Tags is, I assume, the same on each wiki in terms of which tags are linked, but it's pretty long.

I was hoping we could track any linked tags there generically. The second column at https://en.wikipedia.org/wiki/Special:Tags is, I assume, the same on each wiki in terms of which tags are linked, but it's pretty long.

We should be able to track any tag link, the word specific in there just made me think you had particular tags in mind.

As it stands, the tag event names will look like specialDiff.click.mw-tag-marker-<tagname>. Is that okay?

Also, we'll need to specify what attributes we want to merge in from the metrics platform client schema. Here's the list:
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/libs/metrics-platform/+/refs/heads/master/php/src/StreamConfig/data/metrics_platform_client.schema.json#7

[
	'agent_app_install_id',
	'agent_client_platform',
	'agent_client_platform_family',
	'page_id',
	'page_title',
	'page_namespace',
	'page_namespace_name',
	'page_revision_id',
	'page_wikidata_id',
	'page_wikidata_qid',
	'page_content_language',
	'page_is_redirect',
	'page_user_groups_allowed_to_move',
	'page_user_groups_allowed_to_edit',
	'mediawiki_skin',
	'mediawiki_version',
	'mediawiki_is_production',
	'mediawiki_is_debug_mode',
	'mediawiki_database',
	'mediawiki_site_content_language',
	'mediawiki_site_content_language_variant',
	'performer_is_logged_in',
	'performer_id',
	'performer_name',
	'performer_session_id',
	'performer_pageview_id',
	'performer_groups',
	'performer_is_bot',
	'performer_language',
	'performer_language_variant',
	'performer_can_probably_edit_page',
	'performer_edit_count',
	'performer_edit_count_bucket',
	'performer_registration_dt'
]

note that in my local mediawiki docker performer_registration_dt blows up due to it apparently not being stringified.

Change 896432 had a related patch set uploaded (by Jsn.sherman; author: Jsn.sherman):

[operations/mediawiki-config@master] WIP: Log additional click events on Special:Diff

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

jsn.sherman changed the task status from Open to Stalled.Mar 13 2023, 5:03 PM

@Samwalton9: I'll need to have some more info to be able to configure this instrument:

  • At what sampling rate?
  • with what attributes?

@phuedx:

it looks the instrument can be rolled out independently of the config; e.g if there's no stream config for it on a given project, does the dispatch just do nothing? Should I make the instrument patch depend on the config patch, or otherwise associate the two in some way besides the gerrit topic?

In config I noticed that most streams were defined in the default array, but I saw wgEventBusSTreamNamesMap with a release candidate for the mediawiki_page_change stream. Is there a staggered rollout process we should be following with this, or do we just test it in beta and then roll it out in the default eventstreams config?

Also, a note for @Samwalton9: Currently I'm logging watch/unwatch as a single thing, and I'm also logging when the user clicks the thank link initially, rather than when they confirm the thank. We could very easily log those differently if we need to.

Change 898696 had a related patch set uploaded (by Phuedx; author: Phuedx):

[mediawiki/extensions/EventLogging@master] MetricsClientIntegration: Make performer.registration_dt a string

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

note that in my local mediawiki docker performer_registration_dt blows up due to it apparently not being stringified.

Id61c3eacab195795f6a0e40c78d5a48f5923e92e fixes this. I'll create a separate tracking task in a moment.

Edit

See T331972: Value for performer.registration_dt should be a string, not an integer.

@phuedx:

it looks the instrument can be rolled out independently of the config; e.g if there's no stream config for it on a given project, does the dispatch just do nothing? Should I make the instrument patch depend on the config patch, or otherwise associate the two in some way besides the gerrit topic?

That's correct – dispatch should NOP when there are no streams interested in the event being dispatched.

In config I noticed that most streams were defined in the default array, but I saw wgEventBusSTreamNamesMap with a release candidate for the mediawiki_page_change stream. Is there a staggered rollout process we should be following with this, or do we just test it in beta and then roll it out in the default eventstreams config?

The latter – test it on the Beta Cluster and then roll it out in the default value for $wgEventStreams.

As it stands, the tag event names will look like specialDiff.click.mw-tag-marker-<tagname>. Is that okay?

That's great! Clicking on any tag is the main thing we're interested in - if we can figure out which tags are being clicked that's even better!

Also, we'll need to specify what attributes we want to merge in from the metrics platform client schema. Here's the list:
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/libs/metrics-platform/+/refs/heads/master/php/src/StreamConfig/data/metrics_platform_client.schema.json#7

I've pared this down to the attributes we're interested in:

[
	'mediawiki_skin',
	'mediawiki_version',
	'mediawiki_is_production',
	'mediawiki_database',
	'performer_is_logged_in',
	'performer_groups',
	'performer_edit_count_bucket',
	'performer_registration_dt'
]

@Samwalton9: I'll need to have some more info to be able to configure this instrument:

  • At what sampling rate?

Not sure how to answer this one. @phuedx do you have any guidance on how we could evaluate the best sampling rate (if 100% isn't appropriate)? Clicking links in a diff is mostly going to be done by logged-in editors, so this won't be as busy as the other schema we've been using - [mobile/desktop]webuiactionstracking - which I think is at somewhere around 10%, depending on the project.

Also, a note for @Samwalton9: Currently I'm logging watch/unwatch as a single thing, and I'm also logging when the user clicks the thank link initially, rather than when they confirm the thank. We could very easily log those differently if we need to.

I think that's absolutely fine as-is.

Change 898696 merged by jenkins-bot:

[mediawiki/extensions/EventLogging@master] MetricsClientIntegration: Make performer.registration_dt a string

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

  • At what sampling rate?

Not sure how to answer this one. @phuedx do you have any guidance on how we could evaluate the best sampling rate (if 100% isn't appropriate)? Clicking links in a diff is mostly going to be done by logged-in editors, so this won't be as busy as the other schema we've been using - [mobile/desktop]webuiactionstracking - which I think is at somewhere around 10%, depending on the project.

A quick query for pageviews by users between 9 AM and 12 PM yesterday suggests that 91645 (0.11%) were for diff pages [0]. Assuming those pageviews were evenly distributed across those three hours and that your instrument sends one event per pageview, your instrument will send only nine events per second. As I understand it, an instrument sending fewer than 1000 events per second doesn't need special consideration.

Given the above, I would recommend not setting a sampling rate.

[0]
+----------+--------+----------------+
|    n     | n_diff | n_diff_percent |
+----------+--------+----------------+
| 79798847 |  91645 |           0.11 |
+----------+--------+----------------+

select
  n,
  n_diff,
  round( 100 * n_diff / n, 2 ) as n_diff_percent
from (
  select
    sum( 1 ) as n,
    sum( if( uri_query like '%diff=%', 1, 0 ) ) as n_diff
  from
    wmf.webrequest
  where
    is_pageview = true
    and agent_type = 'user'
  
    and year = 2023
    and month = 3
    and day = 14
    and hour >= 9 and hour < 12
) as data
;

P.S. The 0.11% of all pageviews number is born out by data from Turnilo:

The number of sampled pageviews from 13 Feb 16:00 to 15 Mar 16:00 was ~193600000 million. Of those, ~235400 (0.12%) were for diff pages. Note well that the webrequest_sampled_128 data cube includes pageviews from bots, spiders, and users.

P.P.S. Please let me know if I'm querying for diff pages correctly – I've assumed it's user-initiated requests for URLs with diff= in the querystring.

Thanks @phuedx! I believe that should capture the majority of desktop diff pageviews but I think it would miss mobile diffs (example URL: https://en.m.wikipedia.org/wiki/Special:MobileDiff/1144732088?diffmode=source), but they're not going to be 100x more views than desktop, so I think we're good.

jsn.sherman changed the task status from Stalled to In Progress.Mar 15 2023, 6:35 PM
jsn.sherman moved this task from In Progress to Eng review on the Moderator-Tools-Team (Kanban) board.

Okay, in that case my patches for this are ready for review. Thanks all!

Change 895853 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Log additional click events on Special:Diff

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

Change 896432 merged by jenkins-bot:

[operations/mediawiki-config@master] beta: log additional click events on Special:Diff|MobileDiff

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

Samwalton9-WMF changed the task status from In Progress to Stalled.Jun 8 2023, 1:51 PM

Per this Slack thread all new data collection is now supposed to go through Legal for review. Although testing in Beta is OK, this is a blocker to rolling out to Production. I'll get the request submitted shortly.

hi @jsn.sherman - just wanted to follow up about seeing your beta-only stream in beta streams gui -- turns out there was something broken with EventGate. But even still, apparently beta-only stream configs have to be merged with metawiki.

Because stream config is hosted on metawiki, new beta-only streams need to be added via +metawiki override.
The docs just got updated -- see https://wikitech.wikimedia.org/wiki/Event_Platform/Instrumentation_How_To#In_beta.

So in the case of mediawiki.special_diff_interactions, you need to add an entry like so in InitialiseSettings-labs.php under wgEventStreams:

'+metawiki' => [
    'mediawiki.special_diff_interactions' => [
        'schema_title' => '/analytics/mediawiki/client/metrics_event',
        'destination_event_service' => 'eventgate-analytics-external'
    ],

and then your stream name key inside +enwiki can just have the override settings i.e. producers

Once you're cleared by L3SC to push to prod, you can just remove all of this from the labs config file.

hi @jsn.sherman - just wanted to follow up about seeing your beta-only stream in beta streams gui -- turns out there was something broken with EventGate. But even still, apparently beta-only stream configs have to be merged with metawiki.

Because stream config is hosted on metawiki, new beta-only streams need to be added via +metawiki override.
The docs just got updated -- see https://wikitech.wikimedia.org/wiki/Event_Platform/Instrumentation_How_To#In_beta.

So in the case of mediawiki.special_diff_interactions, you need to add an entry like so in InitialiseSettings-labs.php under wgEventStreams:

'+metawiki' => [
    'mediawiki.special_diff_interactions' => [
        'schema_title' => '/analytics/mediawiki/client/metrics_event',
        'destination_event_service' => 'eventgate-analytics-external'
    ],

and then your stream name key inside +enwiki can just have the override settings i.e. producers

Once you're cleared by L3SC to push to prod, you can just remove all of this from the labs config file.

thank you for the update! I'll try again next week.

I was able to test everything but rollback and change visibility (I'm not an admin on en beta)
it looks like the thank instrument will need an update because the confirmable requires two clicks to actually send on desktop. Otherwise, things are working as expected.

prev

{
  "$schema": "/analytics/mediawiki/client/metrics_event/1.2.0",
  "dt": "2023-06-15T14:03:20.085Z",
  "name": "specialDiff.click.prev_link",
  "custom_data": {},
  "meta": {
    "stream": "mediawiki.special_diff_interactions",
    "domain": "en.wikipedia.beta.wmflabs.org",
    "id": "a7b90f3a-d293-45c7-adc7-1bcad0a292de",
    "dt": "2023-06-15T14:03:20.712Z",
    "request_id": "628e4170-0b85-11ee-9931-897bd4c4e7d2",
    "topic": "eqiad.mediawiki.special_diff_interactions",
    "partition": 0,
    "offset": 25
  },
  "mediawiki": {
    "skin": "vector-2022",
    "version": "1.41.0-alpha",
    "is_production": false,
    "database": "enwiki"
  },
  "performer": {
    "is_logged_in": true,
    "groups": [
      "*",
      "user"
    ],
    "edit_count_bucket": "0 edits",
    "registration_dt": "2022-04-13T20:10:01.000Z"
  },
  "agent": {
    "client_platform": "mediawiki_js",
    "client_platform_family": "desktop_browser"
  },
  "http": {
    "request_headers": {
      "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"
    }
  }
}

next

{
  "$schema": "/analytics/mediawiki/client/metrics_event/1.2.0",
  "dt": "2023-06-15T14:03:37.940Z",
  "name": "specialDiff.click.next_link",
  "custom_data": {},
  "meta": {
    "stream": "mediawiki.special_diff_interactions",
    "domain": "en.wikipedia.beta.wmflabs.org",
    "id": "87c2e09b-f2ac-489d-90f3-640dfd1f2f6c",
    "dt": "2023-06-15T14:03:38.801Z",
    "request_id": "6d566b00-0b85-11ee-9931-897bd4c4e7d2",
    "topic": "eqiad.mediawiki.special_diff_interactions",
    "partition": 0,
    "offset": 28
  },
  "mediawiki": {
    "skin": "vector-2022",
    "version": "1.41.0-alpha",
    "is_production": false,
    "database": "enwiki"
  },
  "performer": {
    "is_logged_in": true,
    "groups": [
      "*",
      "user"
    ],
    "edit_count_bucket": "0 edits",
    "registration_dt": "2022-04-13T20:10:01.000Z"
  },
  "agent": {
    "client_platform": "mediawiki_js",
    "client_platform_family": "desktop_browser"
  },
  "http": {
    "request_headers": {
      "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"
    }
  }
}

undo

{
  "$schema": "/analytics/mediawiki/client/metrics_event/1.2.0",
  "dt": "2023-06-15T14:16:51.510Z",
  "name": "specialDiff.click.undo",
  "custom_data": {},
  "meta": {
    "stream": "mediawiki.special_diff_interactions",
    "domain": "en.wikipedia.beta.wmflabs.org",
    "id": "350a264e-72b3-4692-b88a-a7a1839a4857",
    "dt": "2023-06-15T14:16:52.651Z",
    "request_id": "46822990-0b87-11ee-9931-897bd4c4e7d2",
    "topic": "eqiad.mediawiki.special_diff_interactions",
    "partition": 0,
    "offset": 56
  },
  "mediawiki": {
    "skin": "vector-2022",
    "version": "1.41.0-alpha",
    "is_production": false,
    "database": "enwiki"
  },
  "performer": {
    "is_logged_in": true,
    "groups": [
      "*",
      "user"
    ],
    "edit_count_bucket": "1-4 edits",
    "registration_dt": "2022-04-13T20:10:01.000Z"
  },
  "agent": {
    "client_platform": "mediawiki_js",
    "client_platform_family": "desktop_browser"
  },
  "http": {
    "request_headers": {
      "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"
    }
  }
}

thank (double submits, probably due to confirmable):

{
  "$schema": "/analytics/mediawiki/client/metrics_event/1.2.0",
  "dt": "2023-06-15T14:03:31.406Z",
  "name": "specialDiff.click.thank",
  "custom_data": {},
  "meta": {
    "stream": "mediawiki.special_diff_interactions",
    "domain": "en.wikipedia.beta.wmflabs.org",
    "id": "5a23ddc3-eafc-4dc6-ac0f-80576d6941db",
    "dt": "2023-06-15T14:03:38.794Z",
    "request_id": "6d54e460-0b85-11ee-9931-897bd4c4e7d2",
    "topic": "eqiad.mediawiki.special_diff_interactions",
    "partition": 0,
    "offset": 26
  },
  "mediawiki": {
    "skin": "vector-2022",
    "version": "1.41.0-alpha",
    "is_production": false,
    "database": "enwiki"
  },
  "performer": {
    "is_logged_in": true,
    "groups": [
      "*",
      "user"
    ],
    "edit_count_bucket": "0 edits",
    "registration_dt": "2022-04-13T20:10:01.000Z"
  },
  "agent": {
    "client_platform": "mediawiki_js",
    "client_platform_family": "desktop_browser"
  },
  "http": {
    "request_headers": {
      "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"
    }
  }
}
{
  "$schema": "/analytics/mediawiki/client/metrics_event/1.2.0",
  "dt": "2023-06-15T14:03:33.436Z",
  "name": "specialDiff.click.thank",
  "custom_data": {},
  "meta": {
    "stream": "mediawiki.special_diff_interactions",
    "domain": "en.wikipedia.beta.wmflabs.org",
    "id": "63e4af44-2416-473b-a8d3-8adab7a81bb0",
    "dt": "2023-06-15T14:03:38.794Z",
    "request_id": "6d553280-0b85-11ee-9931-897bd4c4e7d2",
    "topic": "eqiad.mediawiki.special_diff_interactions",
    "partition": 0,
    "offset": 27
  },
  "mediawiki": {
    "skin": "vector-2022",
    "version": "1.41.0-alpha",
    "is_production": false,
    "database": "enwiki"
  },
  "performer": {
    "is_logged_in": true,
    "groups": [
      "*",
      "user"
    ],
    "edit_count_bucket": "0 edits",
    "registration_dt": "2022-04-13T20:10:01.000Z"
  },
  "agent": {
    "client_platform": "mediawiki_js",
    "client_platform_family": "desktop_browser"
  },
  "http": {
    "request_headers": {
      "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"
    }
  }
}

view history:

{
  "$schema": "/analytics/mediawiki/client/metrics_event/1.2.0",
  "dt": "2023-06-15T14:06:08.974Z",
  "name": "specialDiff.click.view_history",
  "custom_data": {},
  "meta": {
    "stream": "mediawiki.special_diff_interactions",
    "domain": "en.wikipedia.beta.wmflabs.org",
    "id": "77dc379a-b139-4746-87ac-2978eee423af",
    "dt": "2023-06-15T14:06:09.732Z",
    "request_id": "c74c5b10-0b85-11ee-9931-897bd4c4e7d2",
    "topic": "eqiad.mediawiki.special_diff_interactions",
    "partition": 0,
    "offset": 35
  },
  "mediawiki": {
    "skin": "vector-2022",
    "version": "1.41.0-alpha",
    "is_production": false,
    "database": "enwiki"
  },
  "performer": {
    "is_logged_in": true,
    "groups": [
      "*",
      "user"
    ],
    "edit_count_bucket": "0 edits",
    "registration_dt": "2022-04-13T20:10:01.000Z"
  },
  "agent": {
    "client_platform": "mediawiki_js",
    "client_platform_family": "desktop_browser"
  },
  "http": {
    "request_headers": {
      "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"
    }
  }
}

contribs

{
  "$schema": "/analytics/mediawiki/client/metrics_event/1.2.0",
  "dt": "2023-06-15T14:09:35.914Z",
  "name": "specialDiff.click.contribs",
  "custom_data": {},
  "meta": {
    "stream": "mediawiki.special_diff_interactions",
    "domain": "en.wikipedia.beta.wmflabs.org",
    "id": "d7323bc7-77fc-4f85-9cad-6efd5bc9197c",
    "dt": "2023-06-15T14:09:37.100Z",
    "request_id": "42e63390-0b86-11ee-9931-897bd4c4e7d2",
    "topic": "eqiad.mediawiki.special_diff_interactions",
    "partition": 0,
    "offset": 36
  },
  "mediawiki": {
    "skin": "vector-2022",
    "version": "1.41.0-alpha",
    "is_production": false,
    "database": "enwiki"
  },
  "performer": {
    "is_logged_in": true,
    "groups": [
      "*",
      "user"
    ],
    "edit_count_bucket": "0 edits",
    "registration_dt": "2022-04-13T20:10:01.000Z"
  },
  "agent": {
    "client_platform": "mediawiki_js",
    "client_platform_family": "desktop_browser"
  },
  "http": {
    "request_headers": {
      "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"
    }
  }
}

watchlist

{
  "$schema": "/analytics/mediawiki/client/metrics_event/1.2.0",
  "dt": "2023-06-15T14:10:27.167Z",
  "name": "specialDiff.click.watchlist",
  "custom_data": {},
  "meta": {
    "stream": "mediawiki.special_diff_interactions",
    "domain": "en.wikipedia.beta.wmflabs.org",
    "id": "9250dea5-8bf7-43da-98da-622654351457",
    "dt": "2023-06-15T14:10:53.037Z",
    "request_id": "70296bb0-0b86-11ee-9931-897bd4c4e7d2",
    "topic": "eqiad.mediawiki.special_diff_interactions",
    "partition": 0,
    "offset": 37
  },
  "mediawiki": {
    "skin": "vector-2022",
    "version": "1.41.0-alpha",
    "is_production": false,
    "database": "enwiki"
  },
  "performer": {
    "is_logged_in": true,
    "groups": [
      "*",
      "user"
    ],
    "edit_count_bucket": "0 edits",
    "registration_dt": "2022-04-13T20:10:01.000Z"
  },
  "agent": {
    "client_platform": "mediawiki_js",
    "client_platform_family": "desktop_browser"
  },
  "http": {
    "request_headers": {
      "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"
    }
  }
}

user page

{
  "$schema": "/analytics/mediawiki/client/metrics_event/1.2.0",
  "dt": "2023-06-15T14:11:56.627Z",
  "name": "specialDiff.click.user_link",
  "custom_data": {},
  "meta": {
    "stream": "mediawiki.special_diff_interactions",
    "domain": "en.wikipedia.beta.wmflabs.org",
    "id": "537b2480-a5ec-4c29-a34a-e7b854d1e6b2",
    "dt": "2023-06-15T14:11:58.116Z",
    "request_id": "96f38910-0b86-11ee-9931-897bd4c4e7d2",
    "topic": "eqiad.mediawiki.special_diff_interactions",
    "partition": 0,
    "offset": 38
  },
  "mediawiki": {
    "skin": "vector-2022",
    "version": "1.41.0-alpha",
    "is_production": false,
    "database": "enwiki"
  },
  "performer": {
    "is_logged_in": true,
    "groups": [
      "*",
      "user"
    ],
    "edit_count_bucket": "0 edits",
    "registration_dt": "2022-04-13T20:10:01.000Z"
  },
  "agent": {
    "client_platform": "mediawiki_js",
    "client_platform_family": "desktop_browser"
  },
  "http": {
    "request_headers": {
      "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"
    }
  }
}

tags

{
  "$schema": "/analytics/mediawiki/client/metrics_event/1.2.0",
  "dt": "2023-06-15T14:12:14.179Z",
  "name": "specialDiff.click.tags",
  "custom_data": {},
  "meta": {
    "stream": "mediawiki.special_diff_interactions",
    "domain": "en.wikipedia.beta.wmflabs.org",
    "id": "22064348-d172-4dea-9e8d-56b65ad2106b",
    "dt": "2023-06-15T14:12:14.816Z",
    "request_id": "a0e7e7e0-0b86-11ee-9931-897bd4c4e7d2",
    "topic": "eqiad.mediawiki.special_diff_interactions",
    "partition": 0,
    "offset": 39
  },
  "mediawiki": {
    "skin": "vector-2022",
    "version": "1.41.0-alpha",
    "is_production": false,
    "database": "enwiki"
  },
  "performer": {
    "is_logged_in": true,
    "groups": [
      "*",
      "user"
    ],
    "edit_count_bucket": "0 edits",
    "registration_dt": "2022-04-13T20:10:01.000Z"
  },
  "agent": {
    "client_platform": "mediawiki_js",
    "client_platform_family": "desktop_browser"
  },
  "http": {
    "request_headers": {
      "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"
    }
  }
}

specific tags (visual editor was the first example I came across)

{
  "$schema": "/analytics/mediawiki/client/metrics_event/1.2.0",
  "dt": "2023-06-15T14:13:28.465Z",
  "name": "specialDiff.click.mw-tag-marker-visualeditor-switched",
  "custom_data": {},
  "meta": {
    "stream": "mediawiki.special_diff_interactions",
    "domain": "en.wikipedia.beta.wmflabs.org",
    "id": "21e0e224-add5-4234-bfa6-38b0af50e72a",
    "dt": "2023-06-15T14:13:29.112Z",
    "request_id": "cd2fa900-0b86-11ee-9931-897bd4c4e7d2",
    "topic": "eqiad.mediawiki.special_diff_interactions",
    "partition": 0,
    "offset": 54
  },
  "mediawiki": {
    "skin": "vector-2022",
    "version": "1.41.0-alpha",
    "is_production": false,
    "database": "enwiki"
  },
  "performer": {
    "is_logged_in": true,
    "groups": [
      "*",
      "user"
    ],
    "edit_count_bucket": "0 edits",
    "registration_dt": "2022-04-13T20:10:01.000Z"
  },
  "agent": {
    "client_platform": "mediawiki_js",
    "client_platform_family": "desktop_browser"
  },
  "http": {
    "request_headers": {
      "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"
    }
  }
}

it looks like the thank instrument will need an update because the confirmable requires two clicks to actually send on desktop.

If this is at all complicated, I'm not too bothered if the user actually confirms sending a thanks. That they engaged with the button feels interesting enough to me.

Change 930819 had a related patch set uploaded (by Jsn.sherman; author: Jsn.sherman):

[mediawiki/extensions/WikimediaEvents@master] improve diff logging instrument

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

jsn.sherman changed the task status from Stalled to In Progress.Jun 16 2023, 4:22 PM

it looks like the thank instrument will need an update because the confirmable requires two clicks to actually send on desktop.

If this is at all complicated, I'm not too bothered if the user actually confirms sending a thanks. That they engaged with the button feels interesting enough to me.

It was actually simplest to just get the confirmed thank on desktop. This has the added benefit of measuring the same thing on desktop and mobile.

Change 930819 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] improve diff logging instrument

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

Per this Slack thread all new data collection is now supposed to go through Legal for review. Although testing in Beta is OK, this is a blocker to rolling out to Production. I'll get the request submitted shortly.

This has been approved by Privacy and Legal.

Confirming I see the data in event.mediawiki_special_diff_interactions.