As part of the experiment, it is important for us to measure the dwell time of users reading the automatic translation. This will be necessary to gauge user interest, and also remove any potential noise.
The first step of the task is to decide on a viable approach for this instrumentation.
Approach 1: Using the session ticks instrumentation
Consider if the existing session ticks instrumentation can be used.
Each active user session sends its current length at a pre-determined time interval called a 'tick'. When a user session becomes inactive, it stops sending length updates. If it remains inactive long enough, it will be reset.
Based on the documentation, the tick duration is currently 1 min. However, this is too wide for our use case. We need to check if this can brought down to a few seconds. Additionally, the documentation also mentions.
It is likely that the instrumentation for this metric sends a big amount of events. Sending events every N seconds might have a strong effect of battery drain in mobile (radio gets woken up if phone is on idle and that might be costly). We should take this into account and try to reduce the network usage, i.e. by queuing events and sending them in batches.
Approach 2: Page load and unload event
Similar to web_ui_reading_depth, we have to log page load and unload event.
- Page load: user clicks to view the automatic translation and the translation is loaded.
- Page unload: user exits the automatic translation (in all possible cases).
The difference between client side timestamps can be used to estimate the session length. This might be easier to implement, however, we will have to be sure about data reliability.
