mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-14 09:54:45 +00:00
6c2450a5f2
Use MobileWebShareButton schema to track interactions with Additional changes: Fix how button is injected into page actions bar as last AMC changes broke it. Bug: T207280 Change-Id: Ie7d7ab6bc66df5ab30aaec77e2ee8583c69b8f48
19 lines
560 B
JavaScript
19 lines
560 B
JavaScript
( function ( M, track, user, config ) {
|
|
/**
|
|
* Helper function to track share button usage
|
|
*
|
|
* @param {string} action - one of "shownShareButton", "clickShareButton", "SharedToApp"
|
|
*/
|
|
function trackShare( action ) {
|
|
track( 'event.MobileWebShareButton', {
|
|
pageTitle: config.get( 'wgTitle' ),
|
|
namespaceId: config.get( 'wgNamespaceNumber' ),
|
|
isAnon: user.isAnon(),
|
|
action: action,
|
|
pageToken: user.getPageviewToken()
|
|
} );
|
|
}
|
|
|
|
M.define( 'skins.minerva.share/track', trackShare );
|
|
}( mw.mobileFrontend, mw.track, mw.user, mw.config ) );
|