Kaldari has uploaded a new change for review.

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


Change subject: Add logging support for mobile boolean flag in EchoInteraction
......................................................................

Add logging support for mobile boolean flag in EchoInteraction

Change-Id: I3cb6b9cff91a927b03d30e5f3fec9984cf3f790b
---
M modules/base/ext.echo.base.js
1 file changed, 10 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/73/103573/1

diff --git a/modules/base/ext.echo.base.js b/modules/base/ext.echo.base.js
index cf4d15c..3b8a04c 100644
--- a/modules/base/ext.echo.base.js
+++ b/modules/base/ext.echo.base.js
@@ -9,8 +9,9 @@
                 * Set up event logging for individual notification
                 * @param {JQuery} notification JQuery representing a single 
notification
                 * @param {string} context 'flyout'/'archive'
+                * @param {boolean} mobile True if interaction was on a mobile 
device
                 */
-               setupNotificationLogging: function ( notification, context ) {
+               setupNotificationLogging: function ( notification, context, 
mobile ) {
                        var eventId = +notification.attr( 
'data-notification-event' ),
                                eventType = notification.attr( 
'data-notification-type' );
 
@@ -19,10 +20,10 @@
                                return;
                        }
                        // Log the impression
-                       mw.echo.logInteraction( 'notification-impression', 
context, eventId, eventType );
+                       mw.echo.logInteraction( 'notification-impression', 
context, eventId, eventType, mobile );
                        // Set up logging for clickthrough
                        notification.find( 'a' ).click( function () {
-                               mw.echo.logInteraction( 
'notification-link-click', context, eventId, eventType );
+                               mw.echo.logInteraction( 
'notification-link-click', context, eventId, eventType, mobile );
                        } );
                },
 
@@ -32,8 +33,9 @@
                 * @param {string} context 'flyout'/'archive' or undefined for 
the badge
                 * @param {int} eventId Notification event id
                 * @param {string} eventType notification type
+                * @param {boolean} mobile True if interaction was on a mobile 
device
                 */
-               logInteraction: function ( action, context, eventId, eventType 
) {
+               logInteraction: function ( action, context, eventId, eventType, 
mobile ) {
                        // Check if Schema:EchoInteraction is enabled
                        if ( !mw.echo.clickThroughEnabled ) {
                                return;
@@ -43,7 +45,7 @@
                                action: action
                        };
 
-                       // All the three fields below are optional
+                       // All the fields below are optional
                        if ( context ) {
                                myEvt.context = context;
                        }
@@ -53,6 +55,9 @@
                        if ( eventType ) {
                                myEvt.notificationType = eventType;
                        }
+                       if ( mobile ) {
+                               myEvt.mobile = mobile;
+                       }
                        mw.loader.using( 'ext.eventLogging', function() {
                                mw.eventLog.logEvent( 'EchoInteraction', myEvt 
);
                        } );

-- 
To view, visit https://gerrit.wikimedia.org/r/103573
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3cb6b9cff91a927b03d30e5f3fec9984cf3f790b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Kaldari <rkald...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to