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
This commit is contained in:
Gergő Tisza 2014-06-18 00:50:42 +00:00
parent 2a5aad613c
commit f566f6e585
3 changed files with 6 additions and 2 deletions

View file

@ -903,7 +903,7 @@ $wgExtensionFunctions[] = function () {
global $wgResourceModules, $wgEventLoggingSchemas; global $wgResourceModules, $wgEventLoggingSchemas;
if ( isset( $wgResourceModules['ext.eventLogging'] ) ) { if ( isset( $wgResourceModules['ext.eventLogging'] ) ) {
$wgEventLoggingSchemas[ 'MediaViewer' ] = 8572637; $wgEventLoggingSchemas[ 'MediaViewer' ] = 8922098;
$wgEventLoggingSchemas[ 'MultimediaViewerNetworkPerformance' ] = 7917896; $wgEventLoggingSchemas[ 'MultimediaViewerNetworkPerformance' ] = 7917896;
$wgEventLoggingSchemas[ 'MultimediaViewerDuration' ] = 8572641; $wgEventLoggingSchemas[ 'MultimediaViewerDuration' ] = 8572641;

View file

@ -64,6 +64,7 @@
'defullscreen': 'User exited fullscreen mode.', 'defullscreen': 'User exited fullscreen mode.',
'close': 'User closed Media Viewer.', 'close': 'User closed Media Viewer.',
'file-description-page': 'User opened the file description page.', '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.', 'use-this-file-open': 'User opened the dialog to use this file.',
'image-view': 'User viewed an image.', 'image-view': 'User viewed an image.',
'metadata-open': 'User opened the metadata panel.', 'metadata-open': 'User opened the metadata panel.',

View file

@ -94,7 +94,10 @@
this.buttons.$descriptionPage = this.createButton( this.buttons.$descriptionPage = this.createButton(
'mw-mmv-stripe-button-commons', 'mw-mmv-stripe-button-commons',
mw.message( 'multimediaviewer-description-page-button-text' ).plain() mw.message( 'multimediaviewer-description-page-button-text' ).plain()
); ).click( function () {
mw.mmv.actionLogger.log( 'file-description-page-abovefold' );
} );
}; };
/** /**