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.
- Fixed issue where integrations callback was missing in the typescript definitions file.
- Removed extra logging in HttpXMLUtil
- Retry on failed network calls
- Unsupported URL in React native env
- Promise based approach for all APIs to support async user storage operations
- Added better logging and retries in XHRUtil
- Added better logging in XHRUtil onError handler
- Fixed issue with Advanced implementation of MEG
- Fixed broken JS files from 1.63.1
- Fixed logic which was not affecting VWO Data360-enabled accounts where promise for different APIs was not getting resolved when
returnPromiseFor
is used while launching the SDK. - Fixed issue where promise was not getting resolved in case of pushing an object in
push
API instead of individual custom dimension / visitor property. Only affecting ifreturnPromiseFor
was used at the time of launching the SDK. - Fixed issue where promise was not getting resolved in case of passing
null/undefined/Array
as campaign-key while invoking track API to track more than one same goal at a time across the campaigns. Only affecting ifreturnPromiseFor
was used at the time of launching the SDK.
- Replace weight calculation with a rounded ceil (Merging PR by @samc : #52). This is a patch for a specific customer.
- Catch uncaught exception in HTTP response handling
- When a same user becomes part of multiple similar campaigns they should get different variations
- Send environment key for event arch accounts
- Check for user storage if campaign has MAB enabled
- Support for triggering Data360 metric goal multiple times by same user even if UserStorage is used
- Support for user IP Address and browser user agent to help with bot elimination, IP specific opt out and more options for post segmentation
- Used
typeof
for checking if the value if undefined in case Object.prototype.toString is overridden and returns[object Window]
instead of[object Undefined]
on some websites. This is only applicable for the JavaScript build.
- Modified the revenueProp logic to read from
eventProperties
for data360 enabled accounts. - Updated the code to check for the existence of
eventProperties
and access therevenueProp
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.
- Merged #46 i.e. fixed erro while sending
POST
calls to VWO for Edge runtime environment and JSON/non-JSON response parsing inFetchUtil
- Added new Mutually Exclusive Group implementation with Priority Campaigns and Traffic Allocation
- Added support for frameworks like Next.js which runs on Edge Runtime
- Added support for handling the below operators in targeting and whitelisting
- Greater than
- Greater than equal to
- Less than
- Less than equal to
- Updated missing error log when polling-interval is provided but not the SDK key.
- Downgraded
superstruct
dependency version as the higher version is not supported on Node 6.10.x
- 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
- Update
vwo-sdk-log-messages
dependency to reference npm-published version instead of GitHub tag.
- Fix
isFeatureEnabled
API to handle various cases related to promise based response as mentioned in #34
- Fix variable used for settings-file in case of EU Data residency
- Fix #34 - Promise for isFeatureEnabled is not always resolved
- Fix bundle size of JavaScript SDK by removing node dependencies which got introduced because of previous optimizations in
track
andpush
API.
- 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.
- Fix using tagged version of vwo-sdk-log-messages repo.
npm install
was failing whileyarn install
was working fine.
- 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.
- Expose
LogLevelEnum
on vwoSDK instead ofvwoSDK.logging
. Fixes #29 and #30.
- 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
- Update
webpack.config.js
to useglobalObject.this
flag to make the distributable library compatible with both client-isde as well as server-side rendering engines like Next.js, etc.
-
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.
- Updated
index.d.ts
file with typings related to asynchronous behavior of different APIs whenreturnPromiseFor
is passed inlaunch
API config. - When
isDevelopmentMode
is set totrue
, a log will be shown stating no tracking call will be made corresponding to the APIs. - Added tests to verify APIs are working properly when
returnPromiseFor
andisDevelopmentMode
both are used.
-
All APIs are capable of returning promise i.e. once the decision is made and tracking call to VWO is completed then only API will return. This will increase the overall response time of API as it will include tracking call time.
By default, all APIs are asynchronous i.e. they do not wait for the asynchronous tracking calls to get completed. You get the response
To return a promise, you have to configure the SDK at the time of instantiating i.e. while calling
launch
API.We have provided a way to select which APIs you want to promisify. Rest will continue working normally
To return promise from all the APIs, configure the SDK like:
const vwoInstance = vwoSdk.launch({ settingsFile, returnPromiseFor: { all: true } });
To return a promise from a particular API, for example,
activate
API, configure the SDK like:const vwoInstance = vwoSdk.launch({ settingsFile, returnPromiseFor: { activate: true } });
To return promise from different APIs, for example,
isFeatureEnabled
andtrack
APIs, configure the SDK like:const vwoInstance = vwoSdk.launch({ settingsFile, returnPromiseFor: { isFeatureEnabled: true, track: true } });
- Optimized build for JavaScript SDK by removing unwanted modules like
url
andhttps
(used for Node.js SDK) for sending events tracking calls. Specifically for JavaScript SDK,XMLHttpRequest
is used for which a utility already existed. The gzip minified JavaScript SDK size has been reduced to24.4 kB
from53.2 kB
.
- Increased tests coverage
- Refactored code to write unit tests for verifying tracking calls
- Fix sending
track-user
impression along with the event batching call in case ofisFeatureEnabled
API.
-
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 a hash map
const 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 advancded 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 custome 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.const 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 logic for validating settings-file in case there are no running campaigns
- 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.
- Added support for JavaScript SDK to connect User Storage Service with
getSettingsFile
API so that settings could be stored and fetched before sending a network call. - Added support for two new methods -
getSettings
andsetSettings
in User Storage Service. These will be called by SDK, if provided, whengetSettingsFile
API is invoked.
- Fix code which was using wrong variable to read account ID while generating UUID at the time of integrations callback invocation
- 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.
- Update
superstruct
dependency to the latest version.
- 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.
- Update name of usage metrics keys. Start sending
_l
flag to notify VWO server whether to log or not.
campaignName
will be available in integrations callback, if callback is defined.
- Campaign name will be available in settings and hence, changed settings-schema validations.
- Sending stats which are used for launching the SDK like storage service, logger, and integrations, etc. in tracking calls(track-user and batch-event). This is solely for debugging purpose. We are only sending whether a particular key(feature) 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.
-
TypeScript files were properly formatted using prettier. Prettier will run on
.ts
files whenever a commit is made.
- Added type declaration file to support TypeScript projects.
- Expose lifecycle hook events. This feature allows sending VWO data to third party integrations.
- Introduce
integrations
key inlaunch
API to enable receiving hooks for the third party integrations.
let vwoClientInstance = vwoSDK.launch({
settingsFile,
integrations: {
callback: (properties) => {
console.log(properties);
}
}
});
- Pass meta information from APIs to the User Storage Service's
set
method.
const options = {
metaData: {
browser: 'chrome',
os: 'linux'
}
};
vwoClientInstance.activate(campaignKey, userId, options);
Same for other APIs - getVariationName
, track
, isFeatureEnabled
, and getFeatureVariableValue
.
- 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.
const 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.
let vwoClientInstance = vwoSDK.launch({
settingsFile,
shouldTrackReturningUser: true
});
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.
- Fix build failure on latest node i.e.
15.0.7
version. Error was because of unhandled promise rejection in test cases. - Copyright year changes in all files
- Updated format of message in case settings are not fetched to be same as other log messages.
userStorageData
key can be passed inoptions
parameter for utilizing already fetched storage data. It also helps in implementing the asynchronous nature of the User Storage Service'sget
method. For more info read this.
- Webhooks support
- New API
getAndUpdateSettingsFile
to fetch and update settings-file in case of webhook-trigger
- Polling bugs when settings were updated but not being reflected on instance
- Removed caching util as it causes stale data to be used in case of new settings via polling/webhook
flushEvents
API returns promise to know whether the batch request passes or fails- If
requestTimeInterval
is passed, it will only set the timer when the first event will arrive - If
requestTimeInterval
is provided, after flushing of events, new interval will be registered when the first event will arrive - If
eventsPerRequest
is not provided, the default value of600
i.e.10 minutes
will be used - If
requestTimeInterval
is not provided, the default value of100
events will be used
vwoClientInstance.flushEvents().then(status => {
console.log(status); // true/false depending on network request status
})
- Added support for batching of events sent to VWO server
- Intoduced
batchEvents
config in launch API for setting when to send bulk events - Added
flushEvents
API to manually flush the batch events queue whnebatchEvents
config is passed. Note:batchEvents
config i.e.eventsPerRequest
andrequestTimeInterval
won't be considered while manually flushing
var settingsFile = await vwoSdk.getSettingsFile(accountId, sdkKey);
vwoSdk.lanuch({
settingsFile: settingsFile,
batchEvents: {
eventsPerRequest: 1000, // specify the number of events
requestTimeInterval: 10000, // specify the time limit fordraining the events (in seconds)
flushCallback: (err, events) => console.log(err, events) // optional callback to execute when queue events are flushed
}
});
// (optional): Manually flush the batch events queue to send impressions to VWO server.
vwoClientInstance.flushEvents();
- Added support for polling settingsFile automatically based on the interval provided al the time of using launch API
var settingsFile = await vwoSdk.getSettingsFile(accountId, sdkKey);
vwoSdk.lanuch({
settingsFile: settingsFile,
pollInterval: 1000 // ms,
sdkKey: 'YOUR_SDK_KEY'
})
- Used a util method instead of Object.values since Object.values is not supported in older versions of NodeJs and browsers
- Update track API to handle duplicate and unique conversions and corresponding changes in
launch
API - Update track API to track a goal globally across campaigns with the same
goalIdentififer
and corresponding changes inlaunch
API
// it will track goal having `goalIdentifier` of campaign having `campaignKey` for the user having `userId` as id.
vwoClientInstance.track(campaignKey, userId, goalIdentifier, options);
// it will track goal having `goalIdentifier` of campaigns having `campaignKey1` and `campaignKey2` for the user having `userId` as id.
vwoClientInstance.track([campaignKey1, campaignKey2], userId, goalIdentifier, options);
// it will track goal having `goalIdentifier` of all the campaigns
vwoClientInstance.track(null, userId, goalIdentifier, options);
//Read more about configuration and usage - https://developers.vwo.com/reference#server-side-sdk-track
- Added check in segmentation for handling the scenario in which custom-variable key defined in campaign settings is not passed in APIs and matches regex ".*" is used.
- Remove unused log messages.
- Refactored code. Minified source code is now reduced by 4KB.
- Update year in Apache-2.0 Copyright header in all source and scripts files
- Make
sdkKey
optional while validating settingsFile.sdkKey
will not be present in response ofgetSettingsFile
API fromv1.7.0
.
Client-side Javascript SDK
- NodeJs SDK can be used on client-side i.e. browser with all capabilities like A/B testing, Goal tracking, Feature Rollout, Feature Test, etc.
- Introduced
webpack
for bundling client-sidevwo-javascript-sdk
- Replaced
ajv
dependency withsuperstruct
. Build-size reduced by significant factor
To prevent ordered arguments and increasing use-cases, we are moving all optional arguments into a combined argument(Object).
- customVariables argument in APIs:
activate
,getVariation
,track
,isFeatureEnabled
, andgetFeatureVariableValue
have been moved into options object. revenueValue
parameter intrack
API is now moved intooptions
argument.
// activae API
vwoClientInstance.activate(campaignKey, userId, customVariables);
// getVariation API
vwoClientInstance.getVariation(campaignKey, userId, customVariables);
// track API
vwoClientInstance.track(campaignKey, userId, goalIdentifier, revenueValue, customVariables);
// isFeatureEnabled API
vwoClientInstance.isFeatureEnabled(campaignKey, userId, customVariables);
// getFeatureVariableValue API
vwoClientInstance.getFeatureVariableValue(campaignKey, variableKey, userId, customVariables);
var options = {
// Optional, needed for pre-segmentation
customVariables: {},
// Optional, neeeded for Forced Variation
variationTargetingVariables: {}
// Optional, needed to track revenue goal with revenue value
revenueValue: 1000.12
};
// activae API
vwoClientInstance.activate(campaignKey, userId, options);
// getVariation API
vwoClientInstance.getVariation(campaignKey, userId, options);
// track API
vwoClientInstance.track(campaignKey, userId, goalIdentifier, options);
// isFeatureEnabled API
vwoClientInstance.isFeatureEnabled(campaignKey, userId, options);
// getFeatureVariableValue API
vwoClientInstance.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 custom-targeting-variables as an option for forcing variation
- Code refactored to support Whitelisting. Order of execution
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
- All existing APIs to handle custom-variables for tageting audience
- Code refactored to support campaign tageting and post segmentation
getVariation
andgetVariationName
API are same. Only two names for same API.
- File
getFeaturevariableValue
got renamed togetFeatureVariableValue
. No issues were on MAC OS X as filenames are by default case-insensitve.
Feature Rollout and Feature Test capabilities
- Introduced two new APIs i.e.
isFeatureEnabled
andgetFeatureVariableValue
- Existing APIs to handle new type of campaigns i.e. feature-rollout and feature-test
- Code refactored to support feature-rollout and feature-test capabilites
- 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
- Use User Storage Service in Track API also
- Update track API to use common method
- Fix passing
r
in custom goal type
- Show error when revenue not passed for revenue goals
- Merge pull request #3
- First release with Server-side A/B capabilities