Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/divineomega/php-bucket-testing
🆎 PHP Bucket Testing, A/B testing, split testing
https://github.com/divineomega/php-bucket-testing
a-b-testing bucket-testing frontend-testing split-testing testing ui-testing ux-testing
Last synced: 5 days ago
JSON representation
🆎 PHP Bucket Testing, A/B testing, split testing
- Host: GitHub
- URL: https://github.com/divineomega/php-bucket-testing
- Owner: DivineOmega
- License: lgpl-3.0
- Created: 2018-09-06T15:21:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-06T15:40:55.000Z (over 6 years ago)
- Last Synced: 2024-11-30T19:52:14.234Z (22 days ago)
- Topics: a-b-testing, bucket-testing, frontend-testing, split-testing, testing, ui-testing, ux-testing
- Language: PHP
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Bucket Testing
[![Build Status](https://travis-ci.org/DivineOmega/php-bucket-testing.svg?branch=master)](https://travis-ci.org/DivineOmega/php-bucket-testing)
[![Coverage Status](https://coveralls.io/repos/github/DivineOmega/php-bucket-testing/badge.svg?branch=master)](https://coveralls.io/github/DivineOmega/php-bucket-testing?branch=master)This library enables developers to easily redirect users to different URLs, for the purpose
of bucket testing. Bucket testing is also known as A/B testing or split testing.This type of testing is used to test two or more versions of a webpage to determine which one
performs better based on specfied key metrics, such as clicks, downloads, purchases or any other
form of conversion.## Features
* Random selection of buckets, with optional weights
* Automatic handling of temporary redirects
* Ability to retrieve bucket and manually handle URL redirection
* Easy to use fluent interface syntax## Installation
To install, just run the following composer command.`composer require divineomega/php-bucket-testing`
Remember to include the `vendor/autoload.php` file if your framework does not already do so.
## Usage
```php
use \DivineOmega\BucketTesting\BucketManager;
use \DivineOmega\BucketTesting\Bucket;// Create a new bucket manager
$bucketManager = new BucketManager;// Add buckets, with URLs and optional weights
$bucketManager->add(new Bucket('https://google.co.uk/'))->withWeight(25);
$bucketManager->add(new Bucket('https://php.net/'))->withWeight(75);// Redirect to a randomly selected URL
$bucketManager->redirect();// Or, if you wish, get a random bucket and manually handle the redirection
$bucket = $bucketManager->getRandomBucket();
header('location: '.$bucket->url);```