Merge "Log bucket/token for the DiscussionTools mobile a/b test"

This commit is contained in:
jenkins-bot 2022-12-22 15:12:22 +00:00 committed by Gerrit Code Review
commit 567f1d7183

View file

@ -49,14 +49,21 @@
);
}
function addABTestData( data ) {
// DiscussionTools New Topic A/B test for logged out users
function addABTestData( data, addToken ) {
// DiscussionTools A/B test for logged out users
if ( !mw.config.get( 'wgDiscussionToolsABTest' ) ) {
return;
}
if ( mw.config.get( 'wgDiscussionToolsABTestBucket' ) ) {
data.bucket = mw.config.get( 'wgDiscussionToolsABTestBucket' );
}
if ( mw.user.isAnon() && addToken ) {
var token = mw.cookie.get( 'DTABid', '' );
if ( token ) {
// eslint-disable-next-line camelcase
data.anonymous_user_token = token;
}
}
}
function computeDuration( action, event, timeStamp ) {
@ -232,7 +239,7 @@
}
/* eslint-enable camelcase */
addABTestData( data );
addABTestData( data, true );
logEditViaMetricsPlatform( data, actionPrefix );