Setup ab test experiment debugger

MAILPOET-4972
This commit is contained in:
Oluwaseun Olorunsola
2023-02-07 19:39:11 +01:00
committed by Aschepikov
parent e3c4728529
commit 027f3fbefe
2 changed files with 15 additions and 1 deletions

View File

@ -1,5 +1,11 @@
import { __ } from '@wordpress/i18n'; import { __ } from '@wordpress/i18n';
import { Experiment, Variant, emitter } from '@marvelapp/react-ab-test'; import { MailPoet } from 'mailpoet';
import {
Experiment,
Variant,
emitter,
experimentDebugger,
} from '@marvelapp/react-ab-test';
import { Button } from 'common'; import { Button } from 'common';
import { import {
MailPoetTrackEvent, MailPoetTrackEvent,
@ -48,6 +54,11 @@ emitter.defineVariants(
[50, 50], [50, 50],
); );
experimentDebugger.setDebuggerAvailable(
MailPoet.FeaturesController.isSupported('landingpage_ab_test_debugger'),
);
experimentDebugger.enable();
function AbTestButton() { function AbTestButton() {
return ( return (
<Experiment name={EXPERIMENT_NAME}> <Experiment name={EXPERIMENT_NAME}>

View File

@ -9,11 +9,14 @@ class FeaturesController {
const FEATURE_COUPON_BLOCK = 'Coupon block'; const FEATURE_COUPON_BLOCK = 'Coupon block';
const LANDINGPAGE_AB_TEST_DEBUGGER = 'landingpage_ab_test_debugger';
// Define feature defaults in the array below in the following form: // Define feature defaults in the array below in the following form:
// self::FEATURE_NAME_OF_FEATURE => true, // self::FEATURE_NAME_OF_FEATURE => true,
private $defaults = [ private $defaults = [
self::FEATURE_HOMEPAGE => false, self::FEATURE_HOMEPAGE => false,
self::FEATURE_COUPON_BLOCK => false, self::FEATURE_COUPON_BLOCK => false,
self::LANDINGPAGE_AB_TEST_DEBUGGER => false,
]; ];
/** @var array|null */ /** @var array|null */