Skip to content

Instantly share code, notes, and snippets.

<?php
echo "Hello world!";
businessPluginsNudge: {
datestamp: '20151119',
variations: {
drake: 50,
nudge: 50
},
defaultVariation: 'drake'
}
// Here, the user is assigned one of the variations for this test
// so variation will be either `drake` or `nudge`
var variation = abtest( 'businessPluginsNudge' );
// We can then vary what the user sees based on the variation
// he or she was assigned to
if ( variation === 'drake' ) {
// Do something
} else {
// Do something else
var variation = abtest( 'silverPlan' );
var variation = getABTestVariation( 'silverPlan' );
mixpanel.track( 'Visited Homepage', { abtest_variation: 'white' } );
mixpanel.track( 'Visited Homepage', { abtest_name: 'homepage test 3', abtest_variation: 'white' } );
mixpanel.track( 'Assigned Variation', { abtest_name: 'homepage test 3', abtest_variation: 'white' } );
analytics.tracks.recordEvent( 'calypso_abtest_start', { abtest_name: this.experimentId, abtest_variation: variation } );
ORIGINAL_CONVERSION_RATE = 0.1
VARIATION_OUTCOMES = [-0.2, 0.2]