2017 © Pedro Peláez
 

library laravel-ab-test

A server-side A/B testing tool for Laravel.

image

reallyli/laravel-ab-test

A server-side A/B testing tool for Laravel.

  • Tuesday, July 10, 2018
  • by reallyli
  • Repository
  • 0 Watchers
  • 0 Stars
  • 90 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Laravel 5+ A/B Testing, (*1)

StyleCI Scrutinizer Code Quality, (*2)

A server-side A/B testing tool for Laravel 5+, (*3)

Installation

``` bash composer require reallyli/laravel-ab-test, (*4)


## Configuration Publish the included configuration file: php artisan config:publish reallyli/laravel-ab-test The following configuration options are available: ### Database Connection This is your Laravel database connection that is used to store the A/B testing data. This is handy when you want to store the A/B testing data in a different database. When empty, it will use your default database connection. 'connection' => 'mysql', ### Experiments These are your A/B experiments. These are unique identifiers that you can use in your code or views to decide which version you should be showing. 'experiments' => [ 'old-form', 'new-form', ], ### Goals Without goals, each experiment will track the number of visitors that saw the experiment and detect engagement. Additionally, you can define certain goals that you want to reach with your experiments. If, your main goal is for your visitors to buy your product or contact you for more information, and you have specific routes set up for both of these pages, your goals could look like this: 'goals' => [ 'submit-userinfo', ] Your goals can be relative urls, named routes or can be triggered manually. ## Preparing the A/B test database Once you have selected your database connection, use the included install command to prepare the required tables: php artisan ab:install The database structure is small and lightweight, so it will not impact your application. ## Usage After you have defined your experiments and goals, you can start designing your A/B tests. All your visitors will be given the next experiment that has the least visits. You can request the current experiment identifier with the `AB::experiment()` method. For example, if you have defined the following experiments `['a', 'b', 'c']`, your view could look like this: @if (AB::experiment('old-form')) <input name='username' data-name='old-form-action'> @elseif (AB::experiment('b')) <input name='username' data-name='new-form-action'> @endif Once the visitor is assigned to an experiment, his next clicks are automatically tracked to see if he is engaging with your website or completing certain goals. These goals are relative urls or named routes, and will be marked as completed when a visitor visits that url during an experiment. **NOTE**: Visitors are only tracked if you are conducting an experiment. Only when you ask the current `AB::experiment()`, it will assign an experiment to that user using the current Laravel session. ### Adding new experiments If you want to add new experiments, it may be best to clear the existing A/B testing data with this command: php artisan ab:flush If you don't flush your existing experimental data, all new visitors will see the new experiment first until it catches up with the pageviews of the old experiments. ### Reports A/B testing reports are available through an artisan command: php artisan ab:report This will generate a simple output containing the results for each experiment and their goals. +------------+----------+----------------+---------------+---------------+---------------+ | Experiment | Visitors | Engagement | Buy | Contact | Pricing | +------------+----------+----------------+---------------+---------------+---------------+ | a | 173,074 | 6.0 % (10,363) | 1.3 % (2,249) | 4.8 % (8,307) | 5.3 % (9,172) | | b | 173,073 | 5.1 % (8,826) | 1.1 % (1,903) | 3.5 % (6,057) | 3.9 % (6,749) | | c | 173,073 | 5.0 % (8,653) | 1.0 % (1,730) | 1.3 % (5,538) | 3.2 % (5,538) | +------------+----------+----------------+---------------+---------------+---------------+ You can also export these reports to .csv format using this command: php artisan ab:export /path/to/file.csv If you run that command without a filepath, it will write it to the console. ### Advanced Used to manually trigger an pageview. ```php AB::pageview()

Used to manually trigger an interaction which results in engagement., (*5)

AB::interact()

Used to manually trigger goals. Useful when you want to track goals that are not linked to urls or routes., (*6)

AB::complete($goal)

Get the list of experiments., (*7)

AB::getExperiments()

Get the list of goals., (*8)

AB::getGoals()

Return true if has more than 1 experiment into table "experiments"., (*9)

AB::hasExperiments()

Return the name of the current session experiment., (*10)

AB::currentExperiment()

The Versions

10/07 2018

dev-master

9999999-dev

A server-side A/B testing tool for Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar reallyli

laravel testing ab split optimizely

10/07 2018

1.0.4

1.0.4.0

A server-side A/B testing tool for Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar reallyli

laravel testing ab split optimizely

09/07 2018

1.0.3

1.0.3.0

A server-side A/B testing tool for Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar reallyli

laravel testing ab split optimizely

09/07 2018

1.0.1

1.0.1.0

A server-side A/B testing tool for Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar reallyli

laravel testing ab split optimizely

09/07 2018

1.0.2

1.0.2.0

A server-side A/B testing tool for Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar reallyli

laravel testing ab split optimizely

08/07 2018

1.0.0

1.0.0.0

A server-side A/B testing tool for Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar reallyli

laravel testing ab split optimizely