mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-11-24 00:06:49 +00:00
Log token for the DiscussionTools mobile a/b test
Bug: T321961 Change-Id: If06ba42491ea1ca58aec48a85d0b4a0187702123
This commit is contained in:
parent
dbad7f8987
commit
5b6226841d
|
@ -57,7 +57,7 @@
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function addABTestData( data ) {
|
function addABTestData( data, addToken ) {
|
||||||
// DiscussionTools New Topic A/B test for logged out users
|
// DiscussionTools New Topic A/B test for logged out users
|
||||||
if ( !mw.config.get( 'wgDiscussionToolsABTest' ) ) {
|
if ( !mw.config.get( 'wgDiscussionToolsABTest' ) ) {
|
||||||
return;
|
return;
|
||||||
|
@ -65,6 +65,13 @@
|
||||||
if ( mw.config.get( 'wgDiscussionToolsABTestBucket' ) ) {
|
if ( mw.config.get( 'wgDiscussionToolsABTestBucket' ) ) {
|
||||||
data.bucket = 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var actionPrefixMap = {
|
var actionPrefixMap = {
|
||||||
|
@ -104,7 +111,7 @@
|
||||||
data.user_class = 'IP';
|
data.user_class = 'IP';
|
||||||
}
|
}
|
||||||
|
|
||||||
addABTestData( data );
|
addABTestData( data, true );
|
||||||
|
|
||||||
// Schema's kind of a mess of special properties
|
// Schema's kind of a mess of special properties
|
||||||
if ( data.action === 'init' || data.action === 'abort' || data.action === 'saveFailure' ) {
|
if ( data.action === 'init' || data.action === 'abort' || data.action === 'saveFailure' ) {
|
||||||
|
|
Loading…
Reference in a new issue