Index: branches/wmf/1.17wmf1/extensions/Vector/Vector.php |
— | — | @@ -39,6 +39,10 @@ |
40 | 40 | // Percentage of users who's use of section edit links will be tracked - half of which will see the |
41 | 41 | // new section edit links - default 5% |
42 | 42 | $wgVectorSectionEditLinksLotteryOdds = 5; |
| 43 | +// Version number of the current experiment - Buckets from previous experiments will be overwritten |
| 44 | +// with new values when this is incremented, so as to allow accurate re-distribution. When changing |
| 45 | +// the lottery odds, this needs to change too, or you will have inaccurate data. |
| 46 | +$wgVectorSectionEditLinksExperiment = 0; |
43 | 47 | |
44 | 48 | /* Setup */ |
45 | 49 | |
Property changes on: branches/wmf/1.17wmf1/extensions/Vector/Vector.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
46 | 50 | Merged /trunk/extensions/Vector/Vector.php:r83667 |
Index: branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js |
— | — | @@ -4,7 +4,16 @@ |
5 | 5 | ( function( $, mw ) { |
6 | 6 | |
7 | 7 | if ( mw.config.get( 'wgVectorSectionEditLinksBucketTest', false ) ) { |
8 | | - var bucket = $.cookie( 'ext.vector.sectionEditLinks-bucket' ); |
| 8 | + // If the version in the client's cookie doesn't match wgVectorSectionEditLinksExperiment, then |
| 9 | + // we need to disregard the bucket they may already be in to ensure accurate redistribution |
| 10 | + var currentExperiment = $.cookie( 'ext.vector.sectionEditLinks-experiment' ); |
| 11 | + var experiment = Number( mw.config.get( 'wgVectorSectionEditLinksExperiment', 0 ) ); |
| 12 | + var bucket = null; |
| 13 | + if ( currentExperiment === null || Number( currentExperiment ) != experiment ) { |
| 14 | + $.cookie( 'ext.vector.sectionEditLinks-experiment', experiment ); |
| 15 | + } else { |
| 16 | + bucket = $.cookie( 'ext.vector.sectionEditLinks-bucket' ); |
| 17 | + } |
9 | 18 | if ( bucket === null ) { |
10 | 19 | // Percentage chance of being tracked |
11 | 20 | var odds = Math.min( 100, Math.max( 0, |
— | — | @@ -15,8 +24,8 @@ |
16 | 25 | $.cookie( 'ext.vector.sectionEditLinks-bucket', bucket, { 'path': '/', 'expires': 30 } ); |
17 | 26 | // If we are going to track this person from now on, let's also track which bucket we put |
18 | 27 | // them into and when |
19 | | - if ( bucket > 0 && 'trackActionWithInfo' in $ ) { |
20 | | - $.trackActionWithInfo( 'ext.vector.sectionEditLinks-bucket', bucket ); |
| 28 | + if ( bucket > 0 && 'trackAction' in $ ) { |
| 29 | + $.trackAction( 'ext.vector.sectionEditLinks-bucket:' + bucket + '@' + experiment ); |
21 | 30 | } |
22 | 31 | } |
23 | 32 | } |
— | — | @@ -27,11 +36,12 @@ |
28 | 37 | var editUrl = $( this ).attr( 'href' ); |
29 | 38 | editUrl += ( editUrl.indexOf( '?' ) >= 0 ? '&' : '?' ) + $.param( { |
30 | 39 | 'clicktrackingsession': session, |
31 | | - 'clicktrackingevent': 'ext.vector.sectionEditLinks-bucket' + bucket + '-save' |
| 40 | + 'clicktrackingevent': |
| 41 | + 'ext.vector.sectionEditLinks-bucket:' + bucket + '@' + experiment + '-save' |
32 | 42 | } ); |
33 | 43 | $(this).attr( 'href', mediaWiki.config.get( 'wgScriptPath' ) + '/api.php?' + $.param( { |
34 | 44 | 'action': 'clicktracking', |
35 | | - 'eventid': 'ext.vector.sectionEditLinks-bucket' + bucket + '-click', |
| 45 | + 'eventid': 'ext.vector.sectionEditLinks-bucket:' + bucket + '@' + experiment + '-click', |
36 | 46 | 'token': session, |
37 | 47 | 'redirectto': editUrl |
38 | 48 | } ) ); |
Property changes on: branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js |
___________________________________________________________________ |
Modified: svn:mergeinfo |
39 | 49 | Merged /trunk/extensions/Vector/modules/ext.vector.sectionEditLinks.js:r83667 |
Index: branches/wmf/1.17wmf1/extensions/Vector/Vector.hooks.php |
— | — | @@ -57,6 +57,7 @@ |
58 | 58 | 'configurations' => array( |
59 | 59 | 'wgVectorSectionEditLinksBucketTest', |
60 | 60 | 'wgVectorSectionEditLinksLotteryOdds', |
| 61 | + 'wgVectorSectionEditLinksExperiment', |
61 | 62 | ), |
62 | 63 | 'requirements' => array( |
63 | 64 | 'vector-noexperiments' => false, |