Page MenuHomePhabricator

Log additional click events on Special:MobileDiff
Closed, ResolvedPublic3 Estimated Story Points

Description

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

Specs

Register click events to the following buttons via the Metrics Platform (highlighted) in the MinervaNeue skin.

Thank

image.png (856×396 px, 37 KB)

Previous/Next edit

image.png (639×393 px, 47 KB)

Technical information

TBD

Testing and QA / Acceptance Criteria

  • Clicking the links highlighted above in Special:MobileDiff in the MinervaNeue skin should log an event via the Metrics Platform.

Event Timeline

Samwalton9-WMF renamed this task from Log click events for Thanks on Special:MobileDiff to Log additional click events on Special:MobileDiff.Jan 18 2023, 10:51 AM
Samwalton9-WMF updated the task description. (Show Details)
Samwalton9-WMF updated the task description. (Show Details)
jsn.sherman changed the task status from Open to In Progress.Mar 13 2023, 5:36 PM
jsn.sherman claimed this task.
jsn.sherman moved this task from Ready to In Progress on the Moderator-Tools-Team (Kanban) board.

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

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

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

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

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

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

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

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

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

Change 899725 abandoned by Jsn.sherman:

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

Reason:

abandoned in favor of I78f051bd9370e6c8e9b75129bfb3823dfe11d2dd

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

Change 899674 merged by jenkins-bot:

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

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

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

I verified that mobile logging is working on beta:

I visited this revision:
https://en.m.wikipedia.beta.wmflabs.org/wiki/Special:MobileDiff/571317

and followed the stream topic here:
https://stream-beta.wmflabs.org/v2/ui/#/?streams=mediawiki.special_diff_interactions

previous

{
  "$schema": "/analytics/mediawiki/client/metrics_event/1.2.0",
  "dt": "2023-06-15T13:40:19.615Z",
  "name": "specialMobileDiff.click.prev_link",
  "custom_data": {},
  "meta": {
    "stream": "mediawiki.special_diff_interactions",
    "domain": "en.wikipedia.beta.wmflabs.org",
    "id": "2a1aa7d5-f2cd-4558-816f-28109f77b27d",
    "dt": "2023-06-15T13:40:20.009Z",
    "request_id": "2b978b70-0b82-11ee-9931-897bd4c4e7d2",
    "topic": "eqiad.mediawiki.special_diff_interactions",
    "partition": 0,
    "offset": 22
  },
  "mediawiki": {
    "skin": "minerva",
    "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": "mobile_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

{
  "$schema": "/analytics/mediawiki/client/metrics_event/1.2.0",
  "dt": "2023-06-15T13:40:23.318Z",
  "name": "specialMobileDiff.click.thank",
  "custom_data": {},
  "meta": {
    "stream": "mediawiki.special_diff_interactions",
    "domain": "en.wikipedia.beta.wmflabs.org",
    "id": "16a760b1-9d8c-470a-bddc-e293beedde27",
    "dt": "2023-06-15T13:40:50.732Z",
    "request_id": "3de73280-0b82-11ee-9931-897bd4c4e7d2",
    "topic": "eqiad.mediawiki.special_diff_interactions",
    "partition": 0,
    "offset": 23
  },
  "mediawiki": {
    "skin": "minerva",
    "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": "mobile_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-15T13:42:28.486Z",
  "name": "specialMobileDiff.click.next_link",
  "custom_data": {},
  "meta": {
    "stream": "mediawiki.special_diff_interactions",
    "domain": "en.wikipedia.beta.wmflabs.org",
    "id": "019ce222-0c74-4ca1-bcf1-24afba4d85e8",
    "dt": "2023-06-15T13:42:28.930Z",
    "request_id": "786f05e0-0b82-11ee-9931-897bd4c4e7d2",
    "topic": "eqiad.mediawiki.special_diff_interactions",
    "partition": 0,
    "offset": 24
  },
  "mediawiki": {
    "skin": "minerva",
    "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": "mobile_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"
    }
  }
}

Seeing how we get skin and client_platform_family (either mobile_browser or desktop_browser) I wonder if we actually need separate action names ( eg. specialMobileDiff.click.prev_link and specialDiff.click.prev_link ) for the two interfaces. It seems like it's not strictly necessary, but it may help make it easier to separate them in whatever interface the data folks use. I'll ping someone who is smart about the data things and see what they have to say.

@jsn.sherman I would say it's actually easier to use a single event name and use another field like client_platform_family to split it when necessary. The "split-apply-combine" strategy is very common in data analysis, so our tools generally make it easy to split when necessary (whereas combining without a previous split tends to be less ergonomic).

For example, here's how it appears in Superset, our main dashboarding tool. The "group by" function (as in an SQL GROUP BY) is the split, the "pageview" metric (which is just a sum) is the apply, and outputting a single result table which can be graphed is the combine.

Screenshot 2023-06-15 at 19.47.57.png (1×1 px, 337 KB)

The same is true in Pandas (the main Python library for data analysis): https://pandas.pydata.org/pandas-docs/stable/user_guide/groupby.html

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

This was helpful, thanks!

@jsn.sherman I would say it's actually easier to use a single event name and use another field like client_platform_family to split it when necessary. The "split-apply-combine" strategy is very common in data analysis, so our tools generally make it easy to split when necessary (whereas combining without a previous split tends to be less ergonomic).

For example, here's how it appears in Superset, our main dashboarding tool. The "group by" function (as in an SQL GROUP BY) is the split, the "pageview" metric (which is just a sum) is the apply, and outputting a single result table which can be graphed is the combine.

Screenshot 2023-06-15 at 19.47.57.png (1×1 px, 337 KB)

The same is true in Pandas (the main Python library for data analysis): https://pandas.pydata.org/pandas-docs/stable/user_guide/groupby.html

Change 930819 merged by jenkins-bot:

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

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