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.
- The backoff factor used for all retry attempts has been increased from 1 to 3. This means that the wait time between consecutive retry attempts will now increase more rapidly, allowing for more time between each retry. This helps to reduce repeated rapid requests to the server in case of failures and improves overall stability when transient errors occur.
- Support for Redis user storage
- Added custom property in activate()
- Fixed issue with Advanced implementation of MEG
- 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
- Send environment key for event arch accounts
- 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
- Changed the test cases for MEG new implementation
- 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.
- Print
settings-filein the error log in case ofget_and_update_settings_fileAPI fails to fetch correct settings
- Added new Mutually Exclusive Group implementation with Priority Campaigns and Traffic Allocation
- Fixed
bucket_valuegoing outside permissible limits in some edge cases while bucketing a user into campaign having percent-traffic not equals to 100
- Added stacktrace to exception handling in generic_util
- Refactored Event Batching to handle high concurrent load(impressions being sent to VWO)
- Added
retry_strategyin requests connection. Also, added more error logs in case of HTTP Connection error.
- Added debugging information in the error-log when
batch-eventcall is getting failed
- Updated pyrsistent for latest python versions[
- Added support for handling the below operators in targeting and whitelisting i.e.
- Greater than
- Greater than equal to
- Less than
- Less than equal to
- Update
requirements.txtand makejsonschemarequirement less restrictive[
- Tracking data for the
Data Residencyenabled 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
set_opt_outAPI. 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.set_opt_outAPI 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.vwo_client_instance.set_opt_out()
If you want to opt-in again for tracking by VWO SDK, reinitialize the SDK with the latest settings.
origin/master
-
Support for pushing multiple custom dimensions at once. Earlier, you had to call
pushAPI multiple times for tracking multiple custom dimensions as follows:vwo_client_instance.push("browser", "chrome", user_id) vwo_client_instance.push("price", "20", user_id)
Now, you can pass a dictionary
custom_dimension_map = { "tag_key_1": "tag_value_1", "tag_key_2": "tag_value_2", "tag_key_3": "tag_value_3" } # using named parameters/kwargs vwo_client_instance.push(custom_dimension_map = custom_dimension_map, user_id = user_id) # or positional parameters vwo_client_instance.push({"tag_key_1": "tag_value_1"}, "user_id")
Multiple 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
POSTinstead ofGETand 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
POSTcall would be made to track the same goal across multiple different campaigns running on the same environment. -
Multiple custome dimension can be pushed via
pushAPI. For events architecture enabled account, only one single tracking call would be made to track multiple custom dimensions.custom_dimension_map = { "tag_key_1": "tag_value_1", "tag_key_2": "tag_value_2", "tag_key_3": "tag_value_3" } # using named parameters/kwargs vwo_client_instance.push(custom_dimension_map = custom_dimension_map, user_id = user_id) # or positional parameters vwo_client_instance.push({"tag_key_1": "tag_value_1"}, "user_id")
- Updated whitelisting logs for Feature Rollout campaign
- Test cases added to verify whitelisting cases in Feature Rollout campaign
- Refactored code to prevent multiple calls to get data from User Storage Service, if used.
- Remove
shouldTrackReturningVisitoroption as FullStack campaigns show unique visitors and conversions count. Duplicate visitors/conversions tracking calls would not be made if User Storage Service is used.
- 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.
- 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
activateAPI for a given user and a campaign.
- Sending visitor tracking call for Feature Rollout campaign when
is_feature_enabledAPI is used. This will help in visualizing the overall traffic for the respective campaign's report in the VWO application.
- Feature Rollout and Feature Test campaigns now supports
JSONtype 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
_lflag to notify VWO server whether to log or not.
campaign_namewill be available in integrations callback, if callback is defined.- Environment Key will be passed in event-batching network call to VWO to view environment specific campaign reports.
- 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 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.
- Exposed lifecycle hook events. This feature allows sending VWO data to third party integrations.
- Introduced
integrationsparam inlaunchAPI to enable receiving hooks for the third party integrations.
class Integrations(object):
def __init__(self):
pass
def callback(self, properties):
print(properties)
vwo_instance = vwo.launch(settings_file, integrations=Integrations())- If User Storage Service is provided, do not track same visitor multiple times.
You can pass should_track_returning_user as True in case you prefer to track duplicate visitors.
vwo_client_instance.activate(campaign_key, user_id, should_track_returning_user=True)Or, you can also pass should_track_returning_user at the time of instantiating VWO SDK client. This will avoid passing the flag in different API calls.
vwo_client_instance = vwo.launch(
settings_file=settings_file,
user_storage_service = user_storage_service,
should_track_returning_user=True
)If should_track_returning_user 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
vwo_client_instance.activate(campaign_key, user_id, custom_variables = custom_variables, variation_targeting_variables = variation_targeting_variables)
vwo_client_instance.track(campaign_key, user_id, goal_identifier, custom_variables = custom_variables, variation_targeting_variables = variation_targeting_variables)Wrong Usage
# Calling track API before activate API
# This will not track goal as campaign has not been activated yet.
vwo_client_instance.track(campaign_key, user_id, goal_identifier, custom_variables = custom_variables, variation_targeting_variables = variation_targeting_variables)
# After calling track API
vwo_client_instance.activate(campaign_key, user_id, custom_variables = custom_variables, variation_targeting_variables = variation_targeting_variables)- Added support for batching of events sent to VWO server
- Intoduced
batch_eventsconfig in launch API for setting when to send bulk events - Added
flush_eventsAPI to manually flush the batch events queue whenbatch_eventsconfig is passed. Note:batch_eventsconfig i.e.events_per_requestandrequest_time_intervalwon't be considered while manually flushing - If
request_time_intervalis passed, it will only set the timer when the first event will arrive - If
request_time_intervalis provided, after flushing of events, new interval will be registered when the first event will arrive
def flush_callback(err, events):
print(err)
print(events)
settings_file = vwo.get_settings_file(account_id, sdk_key)
vwo_client_instance = vwo.launch(
settings_file=settings_file,
batch_events={
'events_per_request': 1000, # specify the number of events
'request_time_interval': 10000, # specify the time limit fordraining the events (in seconds)
'flush_callback': flush_callback # optional callback to execute when queue events are flushed
}
)
# (optional): Manually flush the batch events queue to send impressions to VWO server.
vwo_client_instance.flush_events(mode='sync'); // two modes are available sync and async- Webhooks support
- Introduced
get_and_update_settings_fileAPI to fetch and update settings-file in case of webhook-trigger
- Changed copyright header year from 2020 to 2021
- Added
long_description_content_typein setup.py so thatlong_descriptioncan be rendered properly on PyPI.
- Introduced launch API to initialize the VWO instance
- Integrated black formatter and doc_checker pre-push hook for development
from vwo import VWO
vwo_client_instance = VWO(settings_file)from vwo import launch
vwo_client_instance = launch(settings_file)- Update track API to handle duplicate and unique conversions and corresponding changes in VWO
initmethod - Update track API to track a goal globally across campaigns with the same
goal_identifierand corresponding changes in VWOinitmethod
# it will track goal having `goal_identifier` of campaign having `campaign_key` for the user having `user_id` as id.
vwo_client_instance.track(campaign_key, user_id, goal_identifier)
# it will track goal having `goal_identifier` of campaigns having `campaign_key1` and `campaign_key2` for the user having `user_id` as id.
vwo_client_instance.track([campaign_key1, campaign_key2], user_id, goal_identifier)
# it will track goal having `goal_identifier` of all the campaigns
vwo_client_instance.track(None, user_id, goal_identifier)- Updated year in Apache-2.0 Copyright header in all source, tests and scripts files.
- Fixed test case data files to remove ambiguity while running test cases in python 3.5
To prevent ordered arguments and increasing use-cases, we are moving all optional arguments to be passed via kwargs.
- customVariables argument in APIs:
activate,get_variation,track,is_feature_enabled, andget_feature_variable_valuewill now be passed viakwargs. revenueValueparameter intrackAPI viakwargs
# activae API
vwo_client_instance.activate(campaign_key, user_id)
# getVariation API
vwo_client_instance.get_variation(campaign_key, user_id)
# track API
vwo_client_instance.track(campaign_key, user_id, goalIdentifier, revenueValue)
# isFeatureEnabled API
vwo_client_instance.is_feature_enabled(campaign_key, user_id)
# getFeatureVariableValue API
vwo_client_instance.get_feature_variable_value(campaign_key, variableKey, user_id)custom_variables = {}
variation_targeting_variables = {}
# activae API
vwo_client_instance.activate(campaign_key, user_id, custom_variables = custom_variables, variation_targeting_variables = variation_targeting_variables)
# getVariation API
vwo_client_instance.get_variation(campaign_key, user_id, custom_variables = custom_variables, variation_targeting_variables = variation_targeting_variables)
# track API
vwo_client_instance.track(campaign_key, user_id, goalIdentifier, revenue_value = revenue_value, custom_variables = custom_variables, variation_targeting_variables = variation_targeting_variables)
# isFeatureEnabled API
vwo_client_instance.is_feature_enabled(campaign_key, user_id, custom_variables = custom_variables, variation_targeting_variables = variation_targeting_variables)
# getFeatureVariableValue API
vwo_client_instance.get_feature_variable_value(campaign_key, variableKey, user_id, custom_variables = custom_variables, variation_targeting_variables = variation_targeting_variables)Forced Variation capabilites
- Introduced
Forced Variationto 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.
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
- Fix case when no call was made when Control was returned for feature-test in
isFeatureEnabledAPI and feature is not enabled for it.
Feature Rollout and Feature Test capabilities
- Introduced two new APIs i.e.
isFeatureEnabledandgetFeatureVariableValue
- 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
- Fix reusing Singleton class instance by creating new instance on re-initialization of SDK
- First release with Server-side A/B capabilities