Motivation
Users should be able to access terms in all entered languages, but there are too many to always show them all. Therefore, they are categorized in "more languages" (by default expanded) and "all entered languages" (by default collapsed). To be able to know more about how users interact with the language terms, we want to track how often these links are being clicked.
Sample screenshot with the two links
Acceptance Criteria
- Please get the percentage and total number, in how many page visits the "more languages" link was clicked at least once to collapse the languages. (So per page we only count "yes" or "no").
- Please get the percentage and total number, in how many page visits the "more languages" link was clicked at least once to extend the languages again. (So per page we only count "yes" or "no").
- Please get the percentage and total number, if "all entered languages" was clicked to expand the list. (We are not interested if the link was clicked multiple times or not)
Related ticket
T125404: [Wikidata] Tracking UI interaction
Tech Notes
This can be done with mw.track in Javascript.
Example of mw.track in use can be found with event logging in a WMDE extension here: https://github.com/wikimedia/mediawiki-extensions-AdvancedSearch/blob/4d24d5f7da5bc7ab7f686bfb0c89e2eb65e73b70/modules/ext.advancedSearch.init.js#L40
We probably only want to create 1 event called "TermBoxInteraction" or something like that, with one of the fields being the type of interaction. expand, collapse, all for example.
The JS will just have to remember if it has already counted the click for each of the 3 cases so that a single request will only ever log 1 click of each link type per page visit.
Page visit = page visit of the non-crawler user
Page visit data for entities can be taken from the page view tables in hadoop and regenerated afterward.