Extension:E3 Experiments/Testing

Check if the extension is live
To see if it's running, )
 * visit Special:Version on the appropriate wiki
 * in a console like Firebug, Firefox Tools > Web Developer > Web Console or Chrome(ium)'s ? console, enter variables like:
 * mw.activeCampaigns - a JSON structure of campaign info (maintained by ClickTracking extension. may includes Account Creation bucketing)
 * $.cookie('userbuckets')
 * to force a Post-Edit Feedback display, enter mw.experiments.showFeedback('Thanks for playing')
 * (different from the generic JS notification mw.util.jsMessage( 'This is something a message for the user ' );
 * you can print some MediaWiki info pushed to JS variables using mw.config.get mw.config.get(wgUserRegistration) mw:Manual:Interface/JavaScript lists variables you can print, extensions add more.


 * The extension relies upon the ClickTracking extension; to verify that is working in a console you can call
 * $.trackAction('my test string') to trigger a tracking event (generally an XMLHttpRequest posted to api.php)
 * $.getTrackedActions - returns a JSON structure of events that have fired, including the manual trigger above

Test environment
You can set a debug cookie:  to enable debug message output in a JavaScript console. Note that this also disables ClickTracking from logging events.

There are some general query string parameters that alter the behavior of MediaWiki.

For post-edit feedback
This has additional "magic" query string parameters that force certain internal checks to evaluate as true:

Times are represented as number of milliseconds between midnight, January 1, 1970 and the current time, UTC. You can use Epoch Converter to convert a human-readable date to seconds since epoch, then add three zeros to get a value in milliseconds. In a browser's JavaScript console, Date.now will give the value in milliseconds for the current time, and you can get values for other dates using new Date( 'Fri Sep 21 2012' ).getTime, new Date( '2012-09-21' ).getTime , etc.

For account creation UX
It has its own "magic" query string parameters, some similar to PEF, that force certain internal checks to evaluate as true (in flux):

Tips
Many experiments are targeted to newly registered Wikipedia users. In a browser console, the MediaWiki variable for registration date is mw.config.get( 'wgRegistration' ) in UTC (London time, not local time). You can use the dashboard's Campaigns addition to put yourself in a user bucket.

When you see a hard-to-read collection of curly braces like try pasting just the part in curly braces through http://jsonlint.com. Even if the validator fails, it will format it nicely for you.

When you see URL-encoded text like %7B%22AccountCreation%22%3A%5B%22ACP3%22%2C1%5D%7D try pasting it into http://meyerweb.com/eric/tools/dencoder/ and clicking [Decode]. Or in a console, unescape("''paste string here") will approximate this.

Cookies
In the net panel of a debugger, inspect a request, you will see lots of cookies

Once someone is bucketed, he or she gets an updated userbuckets cookie. There are many other cookies set on MediaWiki wikis, here are some:

Test accounts (sockpuppets)
We use test accounts by the bucket load in both test environments like Labs, as well as in production.

If you make a test account on English Wikipedia: it is important that you do the following things:


 * 1) If the accounts makes edits, especially to articles, tag it on the user page with  . This also puts it in a category used to filter out test accounts.
 * 2) Whether you make edits or not, all test accounts that get bucketed should be noted and emailed to Steven, so he can include them in a report to Philippe. This reporting is good courtesy to the community, so that we know what legitimate sockpuppets are out there, in case illegitimate WMF sockpuppets become an issue that merits investigating.

Interactions
Special:Preferences > Appearance > "Exclude me from feature experiments" checkbox...

Events/tracking don't seem to fire on pages in the Special namespace.