AB tests with Symfony 5 made easy

AB tests are not for experimenting things, but to measure them.

Lets run a new AB test with Symfony 5

composer require travaux-com/variantretriever
$affectedVariant = $variantRetriever
->getVariantForExperiment(
new Experiment('my-ab-test'),
(string) $user->getId()
);
$experimentTranslationsKeys = [
'control' => 'email.welcome.subject_control',
'variant' => 'email.welcome.subject_variant',
];
$userVariant = $variantRetriever
->getVariantForExperiment(
new Experiment('my-ab-test'),
(string) $user->getId()
);
$emailSubject = $experimentTranslationsKeys[(string) $userVariant];

Go beyond this example

public function getUserVariantForExperiment(
Experiment $experiment,
User $user
);

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store