mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Merge "Log bucket/token for the DiscussionTools mobile a/b test"
This commit is contained in:
commit
567f1d7183
|
@ -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 );
|
||||
|
||||
|
|
Loading…
Reference in a new issue