Page MenuHomePhabricator

Instrument the arrival to the Confirm step
Closed, ResolvedPublic2 Estimated Story Points

Description

As part of the MinT for Wiki Readers experiment preparations (T381406), the initial pre-pilot report was published.

Based on the funnel analysis, the Confirm step (T359512) seems a point for some users to drop off, and we were wondering if the loading time may be a factor. Unfortunately, the current instrumentation was not allowing to do that analysis since there is no event captured when users reach the Confirm step.

This ticket proposes to instrument the Confirm step in order to capture an event when users reach the Confirm step.

@KCVelaga_WMF can add more details if clarifications are needed about the technical aspects of the instrumentation.

Event Timeline

Change #1169128 had a related patch set uploaded (by Huei Tan; author: Huei Tan):

[mediawiki/extensions/ContentTranslation@master] MinT: Instrument the arrival to the Confirm step

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

@KCVelaga_WMF

When user click on the "confirm step", we log the duration (from page load to user confirm) time together with the click, let me know what's the context key for it

const translationContext = {
	// eslint-disable-next-line camelcase
	source_language: sourceLanguage.value,
	// eslint-disable-next-line camelcase
	target_language: targetLanguage.value,
	// @todo rename << here
	duration: duration
};
logEvent( 'click', 'open', 'auto_translation_card', null, translationContext )

When user click on the "confirm step", we log the duration (from page load to user confirm) time together with the click, let me know what's the context key for it

We can't use the translation fragment for this one as it doesn't have the duration field. Two ways to go about it:

  • update the fragment and schema to include duration field
  • or use actionContext, and log something like, "{duration: secs}" (a JSON blob)

For now, the second approach might be easier and we only have this use case for this specific event.

Thanks, let's use actionContext {duration: secs} in the patch

Do we interested if user leave the page and possible because of page loading time?

if yes then we need to log the "duration" as well when page unload.

Note: Currently, there is no "unload" log event

@KCVelaga_WMF what do you think?

Do we interested if user leave the page and possible because of page loading time?
if yes then we need to log the "duration" as well when page unload.
Note: Currently, there is no "unload" log event

That's a good point. But if a user leaves at this point, I'd assume a session end event would be logged (for example, if a user closes the tab). If we can confirm a session end event, then we don't need a separate unload event.

Note: Currently, there is no "unload" log event

That's a good point. But if a user leaves at this point, I'd assume a session end event would be logged (for example, if a user closes the tab). If we can confirm a session end event, then we don't need a separate unload event.

There is a "click" log event when user close the MinT Wiki Readers, payload in screenshot)

There is no unload log event, meaning that no log when user close the window tab, it sounds like we need to have this "unload" event to have more accurate events.

image.png (430×1 px, 119 KB)

Nikerabbit changed the task status from Open to In Progress.Aug 12 2025, 7:21 AM
Nikerabbit raised the priority of this task from Medium to High.

Merge the latest decision here, from https://phabricator.wikimedia.org/T401580#11077812

New event for unload

actionactionContext
exit"{ duration: sec }"

Existing event for navigating (click)

actionactionContext
clickadd "{ duration: sec }"

note that,
the duration is from page load start to page load finish;
it is possible that the translation is still loading, so we will log the duration from beginning to either exit or click time

We will change the instrumentation to log only the exit when translation is still loading

Translation is still loading; user exits -> event is logged
Translation loaded; user exits -> event is not logged
Translation loaded; user proceeds -> event is not logged

Change #1169128 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] MinT: Instrument the arrival to the Confirm step

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

Confirm the log only happens when translation is still loading on production.