From f566f6e58549e770a46bd297f7c9fcc2a4774d92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20Tisza?= Date: Wed, 18 Jun 2014 00:50:42 +0000 Subject: [PATCH] Log clicks to the above-the-fold file page link This uses best-effort logging (like most other links do), not the blocking call that's used by the other file page link, since analytics folks had severe misgivings about that. Change-Id: I35204420c834fa4fce3dcf81403cb78b92811caf Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/726 --- MultimediaViewer.php | 2 +- resources/mmv/mmv.ActionLogger.js | 1 + resources/mmv/ui/mmv.ui.stripeButtons.js | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/MultimediaViewer.php b/MultimediaViewer.php index eff8baf97..6114864cb 100644 --- a/MultimediaViewer.php +++ b/MultimediaViewer.php @@ -903,7 +903,7 @@ $wgExtensionFunctions[] = function () { global $wgResourceModules, $wgEventLoggingSchemas; if ( isset( $wgResourceModules['ext.eventLogging'] ) ) { - $wgEventLoggingSchemas[ 'MediaViewer' ] = 8572637; + $wgEventLoggingSchemas[ 'MediaViewer' ] = 8922098; $wgEventLoggingSchemas[ 'MultimediaViewerNetworkPerformance' ] = 7917896; $wgEventLoggingSchemas[ 'MultimediaViewerDuration' ] = 8572641; diff --git a/resources/mmv/mmv.ActionLogger.js b/resources/mmv/mmv.ActionLogger.js index 35cc19b0e..f7e6c54c3 100644 --- a/resources/mmv/mmv.ActionLogger.js +++ b/resources/mmv/mmv.ActionLogger.js @@ -64,6 +64,7 @@ 'defullscreen': 'User exited fullscreen mode.', 'close': 'User closed Media Viewer.', 'file-description-page': 'User opened the file description page.', + 'file-description-page-abovefold': 'User opened the file description page via the above-the-fold button.', 'use-this-file-open': 'User opened the dialog to use this file.', 'image-view': 'User viewed an image.', 'metadata-open': 'User opened the metadata panel.', diff --git a/resources/mmv/ui/mmv.ui.stripeButtons.js b/resources/mmv/ui/mmv.ui.stripeButtons.js index 1ee2fcd9f..f0ad23b54 100644 --- a/resources/mmv/ui/mmv.ui.stripeButtons.js +++ b/resources/mmv/ui/mmv.ui.stripeButtons.js @@ -94,7 +94,10 @@ this.buttons.$descriptionPage = this.createButton( 'mw-mmv-stripe-button-commons', mw.message( 'multimediaviewer-description-page-button-text' ).plain() - ); + ).click( function () { + mw.mmv.actionLogger.log( 'file-description-page-abovefold' ); + } ); + }; /**