All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Implemented a timeout mechanism for the
getSettingsFile
API ensuring that the connection is automatically terminated either after the specified timeout period or, by default, after 60 seconds.
use vwo\VWO;
// 10 seconds timeout
// third parameter is false by default and is true only when used after webhook.
$settingsFile = VWO::getSettingsFile(ACCOUNT_ID, SDK_KEY, false, ['timeout' => 10]);
// no timeout, default is 60 seconds
$settingsFile = VWO::getSettingsFile(ACCOUNT_ID, SDK_KEY);
- Support for Redis user storage
- Fixed issue with Advanced implementation of MEG
- Set default values for UA and IP as null
- Issue with multiple trigger goals and goals with where condition not getting triggered multiple times if user storage connected
- When a same user becomes part of multiple similar campaigns they should get different variations
- Check for user storage if campaign has MAB enabled
- Support for user IP Address and browser user agent to help with bot elimination, IP specific opt out and more options for post segmentation
- Modified the revenueProp logic to read from eventProperties for Data360 enabled accounts
- Updated the code to check for existence of eventProperties and access the revenueProp property accordingly
- Update bucketing logic so that variation remains unchanged even after changing campaign traffic distribution. Note: it will not cater the case when user was not part of campaign earlier but started becoming part of campaign after changing the campaign traffic distribution and vice versa.
- Added new Mutually Exclusive Group implementation with Priority Campaigns and Traffic Allocation
- Added support for handling the below operators in targeting and whitelisting
- Greater than
- Greater than equal to
- Less than
- Less than equal to
- Support for triggering a campaign's goal either once or multiple times based on the campaign's goal configuration.
- Allow accepting event properties for tracking events/goals
- Send SDK name, version, and environent-key as event properties for Events Data360 accounts
- For Data360 accounts, enhancements in the
events/t
POST call for the revenue goals/events
- Allow higher versions of
remsey/uuid
dependency so that latest versions of PHP/Laravel could be supported
- Handle Divide by zero error when campaign traffic is zero.
- Update key for reading Data Residency Location from
dataResidencyLocation
tocollectionPrefix
- Removed the dependency of hard-coding paths for reading the log messages. Moved the file reading logic to vwo-sdk-log-messages repo.
-
Always check targeting conditions
-
The option
Once
is selected by default in the VWO Application, which means the user segment condition is only checked once and the same variation is served to the user on every subsequent call to the SDK's APIs. -
If you choose
Always
, the user is evaluated against the segment condition on every call to the SDK's APIs.
-
- Instead of multiple tracking calls in case of global goals, now one single batch call will be made to track different goals of different campaigns having same goal-identifier.
- Instead of multiple tracking calls in case of pushing more than one custom dimension, now one single batch call will be made to push custom dimension map.
- Integrated VWO SDK Log Messages repo instead of hardcoding messages in every VWO server-side SDK.
- Old logs are revamped. New logs that would help in better debugging are added.
- Tracking data for the
Data Residency
enabled VWO accounts will be sent to the configured location - Update year in all the copyright and liense headers
-
In case you want to opt out of tracking by VWO, simply call the
setOptOut
API. This will exclude all the users from any kind of tracking by VWO. This is useful when you just want to make the VWO SDK ineffective without actually removing the associated code.setOptOut
API will also remove unwanted memory footprint by destructing all the instance variables. Calling any other API after this will not be effective i.e. no decision-making or impression would be made to VWO.$vwoClientInstance->setOptOut();
If you want to opt-in again for tracking by VWO SDK, reinitialize the SDK with the latest settings.
-
Support for pushing multiple custom dimensions at once. Earlier, you had to call push API multiple times for tracking multiple custom dimensions as follows:
$vwoInstance->push('browser', 'chrome', $userId); $vwoInstance->push('price', '20', $userId);
Now, you can pass an associative array
$customDimensionMap = [ "browser" => 'chrome', "price" => '20' ]; $vwoInstance->push($customDimensionMap, $userId);
Multiple asynchronous tracking calls would be initiated in this case.
-
If Events Architecture is enabled for your VWO account, all the tracking calls being initiated from SDK would now be
POST
instead ofGET
and there would be single endpoint i.e./events/t
. This is done in order to bring events support and building advanced capabilities in future. -
For events architecture accounts, tracking same goal across multiple campaigns will not send multiple tracking calls. Instead, one single
POST
call would be made to track the same goal across multiple different campaigns running on the same environment. -
Multiple custom dimension can be pushed via
push
API. For events architecture enabled account, only one single asynchronous call would be made to track multiple custom dimensions.
$customDimensionMap = [
"browser" => 'chrome',
"price" => '20'
];
$vwoInstance->push($customDimensionMap, $userId);
- User IDs passed while applying whitelisting in a campaign from VWO Application will now be hashed. Inside settings-file, all User IDs will be hashed for security reasons. SDK will hash the User ID passed in the different APIs before matching it with the campaigns settings. This is feature-controlled from VWO i.e. we are only rolling this functionality gradually. Please reach out to the support team in case you want to opt-in early for this feature for your VWO account.
- Updated whitelisting logs for Feature Rollout campaign
- Test cases added to verify whitelisting cases in Feature Rollout campaign
- Fixed the validation logic for JSON type variable
- Remove
shouldTrackReturningVisitor
option as FullStack campaigns show unique visitors and conversions count. Duplicate visitors/conversions tracking calls would not be made if User Storage Service is used. - Update name of usage metrics keys. Start sending
_l
flag to notify VWO server whether to log or not.
- Use Campaign ID along with User ID for bucketing a user in a campaign. This will ensure that a particular user gets different variation for different campaigns having similar settings i.e. same campaign-traffic, number of variations, and variation traffic.
- Sending visitor tracking call for Feature Rollout campaign when
isFeatureEnabled
API is used. This will help in visualizing the overall traffic for the respective campaign's report in the VWO application.
- Introducing support for Mutually Exclusive Campaigns. By creating Mutually Exclusive Groups in VWO Application, you can group multiple FullStack A/B campaigns together that are mutually exclusive. SDK will ensure that visitors do not overlap in multiple running mutually exclusive campaigns and the same visitor does not see the unrelated campaign variations. This eliminates the interaction effects that multiple campaigns could have with each other. You simply need to configure the group in the VWO application and the SDK will take care what to be shown to the visitor when you will call the
activate
API for a given user and a campaign.
- Feature Rollout and Feature Test campaigns now supports
JSON
type variable which can be created inside VWO Application. This will help in storing grouped and structured data.
- Campaign name will be available in settings and hence, changed settings-schema validations.
- campaignName will be available in integrations callback, if callback is defined.
- Sending stats which are used for launching the SDK like storage service, logger, and integrations, etc. in tracking calls(track-user). This is solely for debugging purpose. We are only sending whether a particular key is used not the actual value of the key.
- Removed sending user-id, that is provided in the various APIs, in the tracking calls to VWO server as it might contain sensitive PII data.
- SDK Key will not be logged in any log message, for example, tracking call logs.
- Expose lifecycle hook events. This feature allows sending VWO data to third party integrations.
- Introduce
integrations
key inVWO
class constructor's argument to enable receiving hooks for the third party integrations.
$config = [
'settingsFile' => $settingsFile,
'integrations' => [
'callback' => function ($properties) {
// $properties will contain all the required VWO specific information
}
]
];
$vwoClientInstance = new VWO($config);
- If User Storage Service is implemented,
isFeatureEnabled
API for not considering variation-level feature flag for Feature Test type campaign.
- Update track API to support tracking a goal globally across campaigns with the same
goalIdentififer
and corresponding changes inVWO
class constructor.
// it will track goal having `goalIdentifier` of campaign having `campaignKey` for the user having `userId` as id.
$vwoClientInstance->track("campaignKey", $goalIdentifier, $userId, $options);
// it will track goal having `goalIdentifier` of campaigns having `campaignKey1` and `campaignKey2` for the user having `userId` as id.
$vwoClientInstance->track(["campaignKey1", "campaignKey2"], $goalIdentifier, $userId, $options);
// it will track goal having `goalIdentifier` of all the campaigns
$vwoClientInstance->track(null, $goalIdentifier, $userId, $options);
//Read more about configuration and usage - https://developers.vwo.com/reference#server-side-sdk-track
- If User Storage Service is provided, do not track same visitor multiple times.
You can pass shouldTrackReturningUser
as true
in case you prefer to track duplicate visitors.
$options = [
"shouldTrackReturningUser" => true
];
$vwoClientInstance->activate($campaignKey, $userId, $options);
Or, you can also pass shouldTrackReturningUser
at the time of instantiating VWO SDK client. This will avoid passing the flag in different API calls.
$config=[
'settingsFile' => $settingsFile,
'shouldTrackReturningUser' => true
];
$vwoClientInstance = new VWO($config);
If shouldTrackReturningUser
param is passed at the time of instantiating the SDK as well as in the API options as mentioned above, then the API options value will be considered.
- If User Storage Service is provided, campaign activation is mandatory before tracking any goal, getting variation of a campaign, and getting value of the feature's variable.
Correct Usage
$vwoClientInstance->activate($campaignKey, $userId, $options);
$vwoClientInstance->track($campaignKey, $userId, $goalIdentifier, $options);
Wrong Usage
// Calling track API before activate API
// This will not track goal as campaign has not been activated yet.
$vwoClientInstance->track($campaignKey, $userId, $goalIdentifier, $options);
// After calling track APi
$vwoClientInstance->activate($campaignKey, $userId, $options);
- Send environment token in every network call initiated from SDK to the VWO server. This will help in viewing campaign reports on the basis of environment.
- Updated namespace for
murmur
to be composer 2 compliant. Fixes #7.
- Make VWO tracking calls asynchronous by using socket connection. This reduces the overall execution time of tracking APIs -
activate
,isFeatureEnabled
,track
, andpush
as the SDK is not blocked on the response of such tracking calls.
- Webhooks support. Updated
getSettingsFile
API to fetch latest settings-file when webhook is triggered.
- Refactor entire SDK - into modular and reusable components
- Improve Test Cases - cleaner & structured code and reusable utitlity functions
- Coverage increased from 83% to ~96% i.e. covering most of the source code via E2E and Unit Tests
- Bugfixes
- pre-segmentation logging issue when evaluated to false
- sending call in case of feature-test when Control is the decision
- Return
null
from APIs in case user is not part of campaign
- Fixed and added new test cases for feature rollout and validation checks
- Mock server-calls, thereby, test-cases execution time reduced from ~1.5 minutes to only ~500ms
- Fix variable naming and update
README.md
file
- Use
bucketinfo
correctly inVWO.php
which was causing weird issues related to decision making in Feature Rollout and Feature Test.
- Updated monolog dependency to allow 2.x versions if php >= 7.2 version is used
- Updated monolog dependency to allow newer versions to be downloaded in update
- Added
composer.lock
into.gitignore
file.
To prevent ordered arguments and increasing use-cases, we are moving all optional arguments into a combined argument(Associative Array).
- customVariables argument in APIs:
activate
,getVariation
,track
,isFeatureEnabled
, andgetFeatureVariableValue
have been moved intooptions
. revenueValue
parameter intrack
API is now moved intooptions
argument.
// activae API
$vwoClient->activate($campaignKey, $userId, $customVariables);
// getVariation API
$vwoClient->getVariation($campaignKey, $userId, $customVariables);
// track API
$vwoClient->track($campaignKey, $userId, $goalIdentifier, $revenueValue, $customVariables);
// isFeatureEnabled API
$vwoClient->isFeatureEnabled($campaignKey, $userId, $customVariables);
// getFeatureVariableValue API
$vwoClient->getFeatureVariableValue($campaignKey, $variableKey, $userId, $customVariables);
$options = [];
$options["customVariables"] = [];
// Optional, neeeded for Forced Variation
$options["variationTargetingVariables"] = [];
// activae API
$vwoClient->activate($campaignKey, $userId, $options);
// getVariation API
$vwoClient->getVariation($campaignKey, $userId, $options);
// track API
// Optional, needed to track revenue goal with revenue value
$options["revenueValue"] = 1000.12;
$vwoClient->track($campaignKey, $userId, $goalIdentifier, options);
// isFeatureEnabled API
$vwoClient->isFeatureEnabled($campaignKey, $userId, $options);
// getFeatureVariableValue API
$vwoClient->getFeatureVariableValue($campaignKey, $variableKey, $userId, $options);
Forced Variation capabilites
- Introduced
Forced Variation
to force certain users into specific variation. Forcing can be based on User IDs or custom variables defined.
- All existing APIs to handle variation-targeting-variables as an option for forcing variation
- Code refactored to support Whitelisting.
- Update endpoint to use
https
protocol instead ofhttp
- Update UserStorage
set
function to properly validate user-data structure before setting
- Move "squizlabs/php_codesniffer" from dependencies to dev-dependencies in
composer.json
- Add
.gitattributes
file for smaller downloads i.e. only required files and folders when downloaded
- Feature Rollout and Feature Test capabilities
- Pre and Post segmentation capabilites Introduced new Segmentation service to evaluate whether user is eligible for campaign based on campaign pre-segmentation conditions and passed custom-variables
- Existing APIs to handle new type of campaigns i.e. feature-rollout and feature-test
- All existing APIs to handle custom-variables for tageting audience
- Code refactored to support feature-rollout, feature-test, campaign tageting and post segmentation
- Change MIT License to Apache-2.0
- Added apache copyright-header in each file
- Add NOTICE.txt file complying with Apache LICENSE
- Give attribution to the third-party libraries being used and mention StackOverflow
- Fix: Update schema validation when no campaigns are running
- Fix: show error log if goal is revenue type but no revenue value is passed in
track
API
- Added more unit test cases
- Update params that are sent to VWO server when track API is used
- Added
.travis.yml
file for running automated test cases on supported PHP versions
- First release with Server-side A/B capabilities