mediawiki-skins-MinervaNeue/resources/skins.minerva.options/trackShare.js
jdlrobson b9862d7d24 skins.minerva.options uses packageFiles
I want to remove the need for M.define in the Minerva repository.
It's no longer necessary with packageFiles and will help tame
a lot of the code we have here!

Change-Id: If6a35a23e84a44adb965fd9c41265ba37eb8368e
2019-07-08 17:22:11 +00:00

19 lines
514 B
JavaScript

( function ( 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()
} );
}
module.exports = trackShare;
}( mw.track, mw.user, mw.config ) );