An open API service indexing awesome lists of open source software.

https://github.com/wingify/vwo-php-sdk

[DEPRECATED] VWO PHP SDK for server-side A/B Testing
https://github.com/wingify/vwo-php-sdk

murmurhash3 php php-sdk server-side vwo

Last synced: 2 months ago
JSON representation

[DEPRECATED] VWO PHP SDK for server-side A/B Testing

Awesome Lists containing this project

README

        

# ⚠️ [DEPRECATED] VWO PHP SDK

**⚠️ This project is no longer actively developed. ⚠️**

**✅ We are only fixing critical bugs and security issues.**

**❌ No new features, enhancements, or non-critical updates will be added.**

#### Switch to *VWO Feature Management & Experimentation(FME)* – The Better Alternative! 🚀

VWO’s FME product empowers teams to seamlessly test, release, optimize, and roll back features across their entire tech stack while minimizing risk and maximizing business impact.

* Check out FME developer documentation [here](https://developers.vwo.com/v2/docs/fme-overview).
* Check [this](https://developers.vwo.com/v2/docs/sdks-release-info ) for the list of all FME-supported SDKs.

**💡 Need Help?**
For migration assistance or any questions, contact us at [[email protected]]([email protected])

------

[![Latest Stable Version](https://img.shields.io/packagist/v/vwo/vwo-php-sdk.svg)](https://packagist.org/packages/vwo/vwo-php-sdk) [![CI](https://github.com/wingify/vwo-php-sdk/workflows/CI/badge.svg?branch=master)](https://github.com/wingify/vwo-php-sdk/actions?query=workflow%3ACI) [![Coverage Status](https://coveralls.io/repos/github/wingify/vwo-php-sdk/badge.svg?branch=master)](https://coveralls.io/github/wingify/vwo-php-sdk?branch=master) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)

This open source library provides you server-side testing capabilities.

## Requirements

> PHP >= 5.6

## Installation

Install the latest version with

```bash
composer require vwo/vwo-php-sdk
```

## Basic Usage

**Use the below code for inital setup.**

```php
$settingsFile,
'isDevelopmentMode' => 0, // optional: 1 to enable the dev mode
'logging' => new CustomLogger(), // optional
'userStorageService' => new userStorageService() // optional
];

$vwoClient = new VWO($sdkConfig);

// to get the variation name along with add a visitor hit to vwo app stats
$variation = $vwoClient->activate($campaignKey, $userId, $options);
// Or, to get the variation name
$variation = $vwoClient->getVariationName($campaignKey, $userId, $options);

// add code here to use variation
//...

/**
*send the track api hit to the vwo app stats to increase conversions
* $revenue is optional send in case if there is any revenue inside $options
*/

$vwoClient->track($campaignKey, $userId, $goalIdentifier, $options);
```

**Code for implementing User Storage Service**

```php
fetch($userId, $campaignKey); // replace with your implementation

return[
'userId' => $userId,
'campaignKey' => $campaignKey,
'variationName' => $variation
];
}

/**
* @param $campaignUserMapping
* @return bool - could be changed
*/
public function set($campaignUserMapping) {
// S...code to store in DB/storage system
return True;
}
}
```

**Code for implementing Custom Logger**

```php