Page MenuHomePhabricator

Mint for Readers: Implement instrumentation for events beyond MVP (set #2)
Closed, ResolvedPublic4 Estimated Story Points

Description

After implementation of key events for the MVP (T363685), the following events can be prioritized for implementation:

  • user changes source language (source: language_selector)*
  • user changes target language (source: language_selector)*
  • automatically translated content viewed
  • user clicks to expand/collapse a section

user clicks to (pre)view a wiki link**

*along with the events for MVP, these events will help us answer how successful are we in helping users reach the automatic translation
**provenance paramater to be added (suggested value: mint1int)

Event Timeline

KCVelaga_WMF triaged this task as Medium priority.
KCVelaga_WMF updated the task description. (Show Details)

@Pginer-WMF I have identified the events mentioned in the task description as priorities for the next set of events to be instrumented. Please review and if you think something else should be prioritized to understand user interactions, we can discuss.

KCVelaga_WMF renamed this task from Mint for Readers: Implement instrumentation for event (beyond MVP; set #2) to Mint for Readers: Implement instrumentation for events beyond MVP (set #2).May 29 2024, 9:59 AM

@Pginer-WMF I have identified the events mentioned in the task description as priorities for the next set of events to be instrumented. Please review and if you think something else should be prioritized to understand user interactions, we can discuss.

Thanks @KCVelaga_WMF, these look good to me. I'll propose the ticket for the next sprint.

@Pginer-WMF @KCVelaga_WMF I strongly believe that we should include the automatically translated content viewed event in this set of events, so that we can accurately track the number of visits of the "View translation" step.

Change #1057868 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] AX: Instrument "automatically translated content viewed" event

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

@ngkountas That's a good idea, thanks for prioritizing this. Does it ensure that this event is only logged once the translation is loaded/viewed? We may want to avoid logging this event is cases where the translation is not loaded properly or broken due to some or the other issue.

KCVelaga_WMF added a subscriber: PWaigi-WMF.

@PWaigi-WMF This is engineering work, I will do the QA after that, which should be a separate task.

@ngkountas That's a good idea, thanks for prioritizing this. Does it ensure that this event is only logged once the translation is loaded/viewed? We may want to avoid logging this event is cases where the translation is not loaded properly or broken due to some or the other issue.

@KCVelaga_WMF the event is logged when the "view translation" step is displayed. That means the event will be logged even if the translation is not loaded properly. I believe that for now, it's more important to track the user's behaviour within the tool (i.e. which screens the user visits, in which order etc), than to measure how often the translation works properly. Of course, the latter is also important but I guess we'll need a new event for that. What do you think?

@KCVelaga_WMF the event is logged when the "view translation" step is displayed. That means the event will be logged even if the translation is not loaded properly. I believe that for now, it's more important to track the user's behaviour within the tool (i.e. which screens the user visits, in which order etc), than to measure how often the translation works properly. Of course, the latter is also important but I guess we'll need a new event for that. What do you think?

Okay, that sounds good. We can have another event for that in that case. I am will be on leave next week, we can discuss about that (the event after content is loaded) once I am back.

Change #1057868 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] AX: Instrument "automatically translated content viewed" event

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

Change #1076787 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] AX instrumentation: Fix "view automatic_translation" event to be logged

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

ngkountas changed the task status from Open to In Progress.Oct 2 2024, 8:01 AM
ngkountas claimed this task.

@KCVelaga_WMF should we just remove the last item (user clicks to (pre)view a wiki link**) from the task description?

Change #1077352 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] MinT for Readers MVP: Instrument source/target language update

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

Change #1077354 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] MinT for Readers MVP: Instrument section expand/collapse event

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

Change #1076787 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] AX instrumentation: Fix "view automatic_translation" event to be logged

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

Change #1077352 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] MinT for Readers MVP: Instrument source/target language update

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

Nikerabbit raised the priority of this task from Medium to High.Feb 17 2025, 8:08 AM
Nikerabbit updated the task description. (Show Details)
Nikerabbit set the point value for this task to 4.Feb 17 2025, 8:11 AM

Change #1077354 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] MinT for Readers MVP: Instrument section expand/collapse event

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

QA results

user changes source language (source: language_selector)*

The event is being logged, however, the action_subtype field is missing. It should be change_source_lang.

Screenshot from 2025-02-25 11-30-33.png (1×1 px, 215 KB)

user changes target language (source: language_selector)*

✅ all good

Screenshot from 2025-02-25 11-30-58.png (1×1 px, 376 KB)

automatically translated content viewed

There are couple of isses: the view event is being logged after user confirms the translation, opens, and the page is loaded. However, the event is being logged a few seconds before the content is loaded. This doesn't seem to the case for all articles. For small articles, it is immediate to the page load, but for longer articles, there is a notable delay between the event being logged and page being loaded.

The view event is not being logged after user changes source or target language, ideally, the event should be logged every time a translation is loaded.

user clicks to expand/collapse a section

✅ all good

Screenshot from 2025-02-25 11-43-06.png (1×1 px, 251 KB)

Nikerabbit updated Other Assignee, added: ngkountas.

Change #1125297 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/ContentTranslation@master] AX Instrumentation: Log "view automatioc_translation" on language change

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

Change #1125298 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/ContentTranslation@master] AX Instrumentation: Tweak when "view automatic_translation" is logged

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

abi_ subscribed.

Previously we were logging the view automatic translation event if 1 item/paragraph from the lead section was loaded...but this could be a hidden element or a very short string. I've updated the code to do so when atleast 3 of them are loaded.

Also fixed the issue with the event not being logged when the source/target language changes.

Change #1125297 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] AX Instrumentation: Log "view automatic_translation" on language change

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

Change #1125427 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/ContentTranslation@master] AX Instrumentation: Add actionContext on source language change

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

Change #1125298 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] AX Instrumentation: Tweak when "view automatic_translation" is logged

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

Change #1125427 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] AX Instrumentation: Add actionSubtype on source language change

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

Previously we were logging the view automatic translation event if 1 item/paragraph from the lead section was loaded...but this could be a hidden element or a very short string. I've updated the code to do so when atleast 3 of them are loaded.

Also fixed the issue with the event not being logged when the source/target language changes.

This is now deployed. I tested this on English Wikipedia and it appears to work as expected.

user changes source language (source: language_selector) ✅

Screenshot from 2025-03-28 22-52-10.png (282×514 px, 63 KB)

automatically translated content viewed ✅

I tested for a few articles, the view is almost simultaneous to initial content being loaded. Also it is being logged after the source or the target language is changed.

Screenshot from 2025-03-28 22-52-31.png (263×507 px, 56 KB)

Screenshot from 2025-03-28 22-53-31.png (263×507 px, 59 KB)

Screenshot from 2025-03-28 22-54-23.png (247×497 px, 55 KB)