mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-27 15:50:29 +00:00
Log bucket/token for the DiscussionTools mobile a/b test
Bug: T321961 Change-Id: I1e809c4405a561b75e59d2c27edbfc8a3e838f09
This commit is contained in:
parent
133cacc42d
commit
d02f753459
|
@ -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