Log all dwelledButAbandoned events

Extract the minimum interaction time of dwelledButAbandoned events to
a unique place: mw.popups.render.DWELL_EVENTS_MIN_INTERACTION_TIME

Lower that interaction time to 0 so that all dwelledButAbandoned events
are logged.

Bug: T145379
Change-Id: Id68183367966b9f0d52e0cd570cab64671a3e87e
This commit is contained in:
joakin 2016-09-13 16:58:31 +02:00 committed by Baha
parent eb852cacd5
commit 9787f515d0
2 changed files with 10 additions and 2 deletions

View file

@ -50,6 +50,14 @@
*/
mw.popups.render.API_DELAY = 50;
/**
* Minimum time to log dwelledButAbandoned events. Initially considered as
* 250ms to avoid accidental hovers being logged. Now logging all events to
* verify data. See T145379
* @property DWELL_EVENTS_MIN_INTERACTION_TIME
*/
mw.popups.render.DWELL_EVENTS_MIN_INTERACTION_TIME = 0;
/**
* Cache of all the popups that were opened in this session
* @property {Object} cache
@ -332,7 +340,7 @@
mw.popups.render.leaveInactive = function () {
if ( logData.dwellStartTime &&
logData.linkInteractionToken &&
mw.now() - logData.dwellStartTime >= 250
mw.now() - logData.dwellStartTime >= mw.popups.render.DWELL_EVENTS_MIN_INTERACTION_TIME
) {
mw.track( 'ext.popups.schemaPopups', $.extend( {}, logData, {
action: 'dwelledButAbandoned',

View file

@ -21,7 +21,7 @@
$this.off( 'mouseleave blur', onLinkAbandon );
if ( data.dwellStartTime && data.linkInteractionToken &&
mw.now() - data.dwellStartTime >= 250
mw.now() - data.dwellStartTime >= mw.popups.render.DWELL_EVENTS_MIN_INTERACTION_TIME
) {
mw.track( 'ext.popups.schemaPopups', {
pageTitleHover: $this.attr( 'title' ),