Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP...

21
Efficient A/B Testing with PHP Arne Blankerts | International PHP Conference 2014

Transcript of Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP...

Page 1: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...

Efficient A/B Testing with PHPArne Blankerts | International PHP Conference 2014

Page 2: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...

Arne BlankertsCo-Founder, The PHP Consulting Company

Page 3: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...
Page 4: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...

What is A/B-Testing?

Page 5: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...

Approach #1

External A/B-Testing Provider

Page 6: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...

External JavaScript1 <!DOCTYPE HTML>2 <html lang="en">3 <head>4 <title>Efficient A/B Testing with PHP </title>5 <meta charset="utf-8">6 <meta name="viewport" content="width=792, user-scalable=no">7 <script src="//ab-provider.net/overlay.js"></script>8 </head>9 <body>10 [...]11 </body>12 </html>

Page 7: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...

External JavaScript• Generic solution• Easy to implement• No actual development needed• Visualisation included

Page 8: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...

External JavaScript - The Downsides• Generic solution• Vendor Lock-in• Operates outside your application• No A/B-Testing for

• Technical implementations• Customer specific decisions• Alternative workflows

• Experiment choice invisible at server side• No access to After-Sales data

Page 9: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...

Approach #2

Build your own

Page 10: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...
Page 11: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...

Decision Making1 <?php23 // ...45 $decisionMaker$decisionMaker = newnew DecisionMaker();6 $choice$choice = $decisionMaker$decisionMaker->decide();78 ifif ($choice$choice == 'variant-A') {9 $view$view = newnew Views\VariantA();10 } elseelse {11 $view$view = newnew Views\VariantB();12 }1314 // ....1516 $view$view->render();

Page 12: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...
Page 13: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...

Decision Making #21 <?php23 $viewLocator$viewLocator = newnew ViewLocator();4 $view$view = $viewLocator$viewLocator->getView();56 // ....78 $view$view->render();

Page 14: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...
Page 15: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...

Remember Decision1 <?php23 $state$state = newnew ExperimentState();4 $viewLocator$viewLocator = newnew ViewLocator($state$state);5 $view$view = $viewLocator$viewLocator->getView();67 // ....89 $view$view->render();

Page 16: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...
Page 17: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...

Report Decision1 <?php2 $state$state = newnew ExperimentState();3 $logger$logger = newnew EventLogger($backend$backend, $state$state);45 $viewLocator$viewLocator = newnew ViewLocator($state$state, $logger$logger);6 $view$view = $viewLocator$viewLocator->getView();78 // ....910 $view$view->render();

Page 18: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...
Page 19: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...
Page 21: Efficient A/B Testing with PHP · Efficient A/B Testing with PHP Author: thePHP.cc - the PHP Consulting Company Created Date: 10/29/2014 10:29:05 PM ...

sharing experience