November 6th, 2024
- Batch UPS lookup and save calls in decideAll and decideForKeys methods (#549).
May 8th, 2024
- Fix logx events discarded for staled connections with httpclient connection pooling (#545).
April 12th, 2024
- OptimizelyFactory method for injecting customHttpClient is fixed to share the customHttpClient for all modules using httpClient (HttpProjectConfigManager, AsyncEventHander, ODPManager) (#542).
- A custom ThreadFactory can be injected to support virtual threads (Loom) (#540).
January 16th, 2024
The 4.0.0 release introduces a new primary feature, Advanced Audience Targeting enabled through integration with Optimizely Data Platform (ODP) ( #474, #481, #482, #483, #484, #485, #487, #489, #490, #494 ).
You can use ODP, a high-performance Customer Data Platform (CDP), to easily create complex real-time segments (RTS) using first-party and 50+ third-party data sources out of the box. You can create custom schemas that support the user attributes important for your business, and stitch together user behavior done on different devices to better understand and target your customers for personalized user experiences. ODP can be used as a single source of truth for these segments in any Optimizely or 3rd party tool.
With ODP accounts integrated into Optimizely projects, you can build audiences using segments pre-defined in ODP. The SDK will fetch the segments for given users and make decisions using the segments. For access to ODP audience targeting in your Feature Experimentation account, please contact your Optimizely Customer Success Manager.
This version includes the following changes:
- New API added to
OptimizelyUserContext
:fetchQualifiedSegments()
: this API will retrieve user segments from the ODP server. The fetched segments will be used for audience evaluation. The fetched data will be stored in the local cache to avoid repeated network delays.- When an
OptimizelyUserContext
is created, the SDK will automatically send an identify request to the ODP server to facilitate observing user activities.
- New APIs added to
OptimizelyClient
:sendOdpEvent()
: customers can build/send arbitrary ODP events that will bind user identifiers and data to user profiles in ODP.
For details, refer to our documentation pages:
- Advanced Audience Targeting
- Server SDK Support
- Initialize Java SDK
- OptimizelyUserContext Java SDK
- Advanced Audience Targeting segment qualification methods
- Send Optimizely Data Platform data using Advanced Audience Targeting
OdpManager
in the SDK is enabled by default, if initialized using OptimizelyFactory. Unless an ODP account is integrated into the Optimizely projects, mostOdpManager
functions will be ignored. If needed, ODP features can be disabled by initializingOptimizelyClient
without passingOdpManager
.ProjectConfigManager
interface has been changed to add 2 more methodsgetCachedConfig()
andgetSDKKey()
. Custom ProjectConfigManager should implement these new methods. SeePollingProjectConfigManager
for reference. This change is required to support ODPManager updated on datafile download (#501).
- Fix thread leak from httpClient in HttpProjectConfigManager (#530).
- Fix issue when vuid is passed as userid for
AsyncGetQualifiedSegments
(#527). - Fix to support arbitrary client names to be included in logx and odp events (#524).
- Add evict timeout to logx connections (#518).
- Update Github Issue Templates (#531)
August 28th, 2023
- Fix thread leak from httpClient in HttpProjectConfigManager (#530).
- Fix issue when vuid is passed as userid for
AsyncGetQualifiedSegments
(#527). - Fix to support arbitrary client names to be included in logx and odp events (#524).
- Update Github Issue Templates (#531)
June 8th, 2023
- Fix intermittent logx event dispatch failures possibly caused by reusing stale connections. Add
evictIdleConnections
(1min) toOptimizelyHttpClient
inAsyncEventHandler
to force close persistent connections after 1min idle time (#518).
May 5th, 2023
The 4.0.0-beta release introduces a new primary feature, Advanced Audience Targeting enabled through integration with Optimizely Data Platform (ODP) ( #474, #481, #482, #483, #484, #485, #487, #489, #490, #494 ).
You can use ODP, a high-performance Customer Data Platform (CDP), to easily create complex real-time segments (RTS) using first-party and 50+ third-party data sources out of the box. You can create custom schemas that support the user attributes important for your business, and stitch together user behavior done on different devices to better understand and target your customers for personalized user experiences. ODP can be used as a single source of truth for these segments in any Optimizely or 3rd party tool.
With ODP accounts integrated into Optimizely projects, you can build audiences using segments pre-defined in ODP. The SDK will fetch the segments for given users and make decisions using the segments. For access to ODP audience targeting in your Feature Experimentation account, please contact your Optimizely Customer Success Manager.
This version includes the following changes:
- New API added to
OptimizelyUserContext
:fetchQualifiedSegments()
: this API will retrieve user segments from the ODP server. The fetched segments will be used for audience evaluation. The fetched data will be stored in the local cache to avoid repeated network delays.- When an
OptimizelyUserContext
is created, the SDK will automatically send an identify request to the ODP server to facilitate observing user activities.
- New APIs added to
OptimizelyClient
:sendOdpEvent()
: customers can build/send arbitrary ODP events that will bind user identifiers and data to user profiles in ODP.
For details, refer to our documentation pages:
- Advanced Audience Targeting
- Server SDK Support
- Initialize Java SDK
- OptimizelyUserContext Java SDK
- Advanced Audience Targeting segment qualification methods
- Send Optimizely Data Platform data using Advanced Audience Targeting
OdpManager
in the SDK is enabled by default, if initialized using OptimizelyFactory. Unless an ODP account is integrated into the Optimizely projects, mostOdpManager
functions will be ignored. If needed,OdpManager
to be disabled initializeOptimizelyClient
without passingOdpManager
.ProjectConfigManager
interface has been changed to add 2 more methodsgetCachedConfig()
andgetSDKKey()
. Custom ProjectConfigManager should implement these new methods. SeePollingProjectConfigManager
for reference. This change is required to support ODPManager updated on datafile download (#501).
March 13th, 2023
We updated our README.md and other non-functional code to reflect that this SDK supports both Optimizely Feature Experimentation and Optimizely Full Stack (#506).
March 17th, 2022
- For some audience condition matchers (semantic-version, le, or ge), SDK logs WARNING messages when the attribute value is missing. This is fixed down to the DEBUG level to be consistent with other condition matchers (#463).
- Add an option to specify the client-engine version (android-sdk, etc) in the Optimizely builder (#466).
February 3rd, 2022
- Fix NotificationManager to be thread-safe (add-handler and send-notifications can happen concurrently) (#460).
January 10th, 2022
- Add a set of new APIs for overriding and managing user-level flag, experiment and delivery rule decisions. These methods can be used for QA and automated testing purposes. They are an extension of the OptimizelyUserContext interface (#451, #454, #455, #457)
- setForcedDecision
- getForcedDecision
- removeForcedDecision
- removeAllForcedDecisions
- For details, refer to our documentation pages: OptimizelyUserContext and Forced Decision methods.
September 16th, 2021
-
Added new public properties to OptimizelyConfig. [#434] (#434), [#438] (#438)
- sdkKey
- environmentKey
- attributes
- events
- audiences and audiences in OptimizelyExperiment
- experimentRules
- deliveryRules
-
OptimizelyFeature.experimentsMap of OptimizelyConfig is now deprecated. Please use OptimizelyFeature.experiment_rules and OptimizelyFeature.delivery_rules. [#440] (#440)
-
For more information please refer to Optimizely documentation: [https://docs.developers.optimizely.com/full-stack/docs/optimizelyconfig-java]
-
Added custom closeableHttpClient for custom proxy support. [#441] (#441)
March 8th, 2021
- Fix intermittent SocketTimeout exceptions while downloading datafiles. Add configurable
evictIdleConnections
toHttpProjectConfigManager
to force close persistent connections after the idle time (evict after 1min idle time by default) (#431).
March 2nd, 2021
Switch publish repository to MavenCentral (bintray/jcenter sunset)
February 3rd, 2021
-
Introducing a new primary interface for retrieving feature flag status, configuration and associated experiment decisions for users (#406, #415, #417). The new
OptimizelyUserContext
class is instantiated withcreateUserContext
and exposes the following APIs to getOptimizelyDecision
:- setAttribute
- decide
- decideAll
- decideForKeys
- trackEvent
-
For details, refer to our documentation page: https://docs.developers.optimizely.com/full-stack/v4.0/docs/java-sdk.
- Close the closable response from apache httpclient (#419)
January 14th, 2021
- Clone user-context before calling Optimizely decide (#417)
- Return reasons as a part of tuple in decision hierarchy (#415)
December 14th, 2020
-
Introducing a new primary interface for retrieving feature flag status, configuration and associated experiment decisions for users. The new
OptimizelyUserContext
class is instantiated withcreateUserContext
and exposes the following APIs (#406):- setAttribute
- decide
- decideAll
- decideForKeys
- trackEvent
-
For details, refer to our documentation page: https://docs.developers.optimizely.com/full-stack/v4.0/docs/java-sdk.
November 20th, 2020
- Add support for upcoming application-controlled introduction of tracking for non-experiment Flag decisions. (#405, #409, #410)
- Upgrade httpclient to 4.5.13
September 30th, 2020
-
Add support for version audience condition which follows the semantic version (http://semver.org)[#386](https://github.com/optimizely/java-sdk/pull/386).
-
Add support for datafile accessor #392.
-
Audience logging refactor (move from info to debug) #380.
-
Added SetDatafileAccessToken method in OptimizelyFactory #384.
-
Add MatchRegistry for custom match implementations. [#390] (#390).
-
logging issue in quick-start application [#402] (#402).
-
Update libraries to latest to avoid vulnerability issues #397.
July 7th, 2020
- Add support for JSON feature variables (#372, #371, #375)
- Add support for authenticated datafile access (#378)
- Adjust log level on audience evaluation logs (#377)
July 2nd, 2020
- Add support for JSON feature variables (#372, #371, #375)
- Add support for authenticated datafile access (#378)
- Adjust log level on audience evaluation logs (#377)
April 28th, 2020
- Change FeatureVariable type from enum to string for forward compatibility. (#370)
March 30th, 2020
- Change log level to debug for "Fetching datafile from" in HttpProjectConfigManager. (#362)
- Change log level to warn when experiments are not in datafile. (#361)
January 30th, 2020
- Remove usage of stream to support Android API 21 and 22. (#357)
January 27th, 2020
- Added a new API to get project configuration static data.
- Call
getOptimizelyConfig()
to get a snapshot of project configuration static data. - It returns an
OptimizelyConfig
instance which includes a datafile revision number, all experiments, and feature flags mapped by their key values. - Added caching for
getOptimizelyConfig
-OptimizelyConfig
object will be cached and reused for the lifetime of the datafile. - For details, refer to our documentation page: https://docs.developers.optimizely.com/full-stack/docs/optimizelyconfig-java.
- Call
December 16th, 2019
- Accept http client parameters via system properties. (#349)
December 16th, 2019
- Accept http client parameters via system properties. (#349)
November 14th, 2019
- Require EventHandler in BatchEventProcessor builder. (#333)
- Defend against invalid BatchEventProcessor configuration overrides. i(#331)
October 23rd, 2019
- The BatchEventProcessor was refactored for performance so that it ends up hanging on the blocking queue if there is nothing to processes. (#343)
October 11th, 2019
- java.util.Supplier is not supported below Android API 24. In order to support Android 22 which still has more than 10% market share, we have changed our implementation to use our own config supplier interface.
October 1st, 2019
- Introduced
EventProcessor
interface withBatchEventProcessor
implementation. - Introduced
LogEvent
notification. - Added
BatchEventProcessor
as the default implementation within theOptimizelyFactory
class.
LogEvent
was deprecated fromTrackNotification
andActivateNotification
notifications in favor of explicitLogEvent
notification.
August 19th, 2019
- Add clear deprecation path from factory builder method.
- Make Optimizely#withDatafile public.
July 24th, 2019
- Introduced
EventProcessor
interface withBatchEventProcessor
implementation. - Introduced
LogEvent
notification. - Added
BatchEventProcessor
as the default implementation within theOptimizelyFactory
class.
LogEvent
was deprecated fromTrackNotification
andActivateNotification
notifications in favor of explicitLogEvent
notification.
June 26th, 2019
- Added support for automatic datafile management via
HttpProjectConfigManager
:- The
HttpProjectConfigManager
is part of thecore-httpclient-impl
package and is an implementation of the abstractPollingProjectConfigManager
class. - Users must first build the
HttpProjectConfigManager
with an SDK key and then and provide that instance to the Optimizely.Builder. - An initial datafile can be provided to the
HttpProjectConfigManager
to bootstrap before making http requests for the hosted datafile. - Requests for the datafile are made in a separate thread and are scheduled with fixed delay.
- Configuration updates can be subscribed to via the
Optimizely#addUpdateConfigNotificationHandler
or by subscribing to the NotificationCenter built with theHttpProjectConfigManager
.
- The
- Added
AsyncEventHandler.Builder
to be consistent with other Optimizely resources. - The
OptimizelyFactory
was included in thecore-httpclient-impl
package and provides basic methods for instantiating the Optimizely SDK with a minimal number of parameters. - Default configuration options for
HttpProjectConfigManager
andAsyncEventHandler
can be overwritten using Java system properties, environment variables or via anoptimizely.properties
file to avoid hard coding the configuration options.
Optimizely.builder(String, EventHandler)
was deprecated in favor of pure builder methodswithConfigManager
andwithEventHandler
.
May 23rd, 2019
- Added support for automatic datafile management via
HttpProjectConfigManager
:- The
HttpProjectConfigManager
is part of thecore-httpclient-impl
package and is an implementation of the abstractPollingProjectConfigManager
class. - Users must first build the
HttpProjectConfigManager
with an SDK key and then and provide that instance to the Optimizely.Builder. - An initial datafile can be provided to the
HttpProjectConfigManager
to bootstrap before making http requests for the hosted datafile. - Requests for the datafile are made in a separate thread and are scheduled with fixed delay.
- Configuration updates can be subscribed to via the
Optimizely#addUpdateConfigNotificationHandler
or by subscribing to the NotificationCenter built with theHttpProjectConfigManager
.
- The
- Added
AsyncEventHandler.Builder
to be consistent with other Optimizely resources. - The
OptimizelyFactory
was included in thecore-httpclient-impl
package and provides basic methods for instantiating the Optimizely SDK with a minimal number of parameters. - Default configuration options for
HttpProjectConfigManager
andAsyncEventHandler
can be overwritten using Java system properties, environment variables or via anoptimizely.properties
file to avoid hard coding the configuration options.
Optimizely.builder(String, EventHandler)
was deprecated in favor of pure builder methodswithConfigManager
andwithEventHandler
.
May 6th, 2019
- Introduced Decision notification listener to be able to record:
- Variation assignments for users activated in an experiment.
- Feature access for users.
- Feature variable value for users.
- Added APIs to be able to conveniently add Decision notification handler (
addDecisionNotificationHandler
) and Track notification handler (addTrackNotificationHandler
).
- Feature variable APIs return default variable value when featureEnabled property is false. (#274)
- Activate notification listener is deprecated as of this release. Recommendation is to use the new Decision notification listener. Activate notification listener will be removed in the next major release.
addActivateNotificationListener
,addTrackNotificationListener
andaddNotificationListener
APIs onNotificationCenter
.
April 23, 2019
This is a simple fix so that older versions of org.json can still parse the datafile.
We use org.json.JSONArray. Older versions do not support the iterator. In order to ensure that the datafile is still parsable if you use a older version, we changed to use the get method instead of the iterator. (#283)
February 13, 2019
The 3.0 release improves event tracking and supports additional audience targeting functionality.
- Event tracking:
- The
track
method now dispatches its conversion event unconditionally, without first determining whether the user is targeted by a known experiment that uses the event. This may increase outbound network traffic. - In Optimizely results, conversion events sent by 3.0 SDKs don't explicitly name the experiments and variations that are currently targeted to the user. Instead, conversions are automatically attributed to variations that the user has previously seen, as long as those variations were served via 3.0 SDKs or by other clients capable of automatic attribution, and as long as our backend actually received the impression events for those variations.
- Altogether, this allows you to track conversion events and attribute them to variations even when you don't know all of a user's attribute values, and even if the user's attribute values or the experiment's configuration have changed such that the user is no longer affected by the experiment. As a result, you may observe an increase in the conversion rate for previously-instrumented events. If that is undesirable, you can reset the results of previously-running experiments after upgrading to the 3.0 SDK.
- This will also allow you to attribute events to variations from other Optimizely projects in your account, even though those experiments don't appear in the same datafile.
- Note that for results segmentation in Optimizely results, the user attribute values from one event are automatically applied to all other events in the same session, as long as the events in question were actually received by our backend. This behavior was already in place and is not affected by the 3.0 release.
- The
- Support for all types of attribute values, not just strings:
- All values are passed through to notification listeners.
- Strings, booleans, and valid numbers are passed to the event dispatcher and can be used for Optimizely results segmentation. A valid number is a finite float, double, integer, or long in the inclusive range [-2⁵³, 2⁵³].
- Strings, booleans, and valid numbers are relevant for audience conditions.
- Support for additional matchers in audience conditions:
- An
exists
matcher that passes if the user has a non-null value for the targeted user attribute and fails otherwise. - A
substring
matcher that resolves if the user has a string value for the targeted attribute. gt
(greater than) andlt
(less than) matchers that resolve if the user has a valid number value for the targeted attribute. A valid number is a finite float, double, integer, or long in the inclusive range [-2⁵³, 2⁵³].- The original (
exact
) matcher can now be used to target booleans and valid numbers, not just strings.
- An
- Support for A/B tests, feature tests, and feature rollouts whose audiences are combined using
"and"
and"not"
operators, not just the"or"
operator. - Datafile-version compatibility check: The SDK will remain uninitialized (i.e., will gracefully fail to activate experiments and features) if given a datafile version greater than 4.
- Updated Pull Request template and commit message guidelines.
- When given an invalid datafile, the Optimizely client object now instantiates into a no-op state instead of throwing a
ConfigParseException
. This matches the behavior of the other Optimizely SDKs. - Support for graceful shutdown in the default, async event dispatcher.
- Java 7 is no longer supported.
- Conversion events sent by 3.0 SDKs don't explicitly name the experiments and variations that are currently targeted to the user, so these events are unattributed in raw events data export. You must use the new results export to determine the variations to which events have been attributed.
- Previously, notification listeners were only given string-valued user attributes because only strings could be passed into various method calls. That is no longer the case. The
ActivateNotificationListener
andTrackNotificationListener
interfaces now receive user attributes asMap<String, ?>
instead ofMap<String, String>
.
- Experiments and features can no longer activate when a negatively targeted attribute has a missing, null, or malformed value.
- Audience conditions (except for the new
exists
matcher) no longer resolve tofalse
when they fail to find an legitimate value for the targeted user attribute. The result remainsnull
(unknown). Therefore, an audience that negates such a condition (using the"not"
operator) can no longer resolve totrue
unless there is an unrelated branch in the condition tree that itself resolves totrue
.
- Audience conditions (except for the new
- Support for empty user IDs. (#220)
- Sourceclear flagged jackson-databind 2.9.4 fixed in 2.9.8 (#260)
- Fix the quick-start app to create a unique user for every impression/conversion in a run. (#257)
December 6th, 2018
- fix/wrap in try catch for getting build version in static init which might crash (#241)
November 20th, 2018
This is the release candidate for the 3.0 SDK, which includes a number of improvements to audience targeting along with a few bug fixes.
- Support for number-valued and boolean-valued attributes. (#213)
- Support for audiences with new match conditions for attribute values, including “substring” and “exists” matches for strings; “greater than”, “less than”, exact, and “exists” matches for numbers; and “exact”, and “exists” matches for booleans.
- Built-in datafile version compatibility checks so that SDKs will not initialize with a newer datafile it is not compatible with. (#209)
- Audience combinations within an experiment are unofficially supported in this release.
- Refactor EventDispatcher to handle graceful shutdown via a call to AsyncEventHandler.shutdownAndAwaitTermination.
- Previously, notification listeners filtered non-string attribute values from the data passed to registered listeners. To support our growing list of supported attribute values, we’ve changed this behavior. Notification listeners will now post any value type passed as an attribute. Therefore, the interface of the notification listeners has changed to accept a
Map<String, ?>
. - Update to use Java 1.7 (#208)
- refactor: Performance improvements for JacksonConfigParser (#209)
- refactor: typeAudience.combinations will not be string encoded like audience.combinations. To handle this we created a new parsing type TypedAudience.
- fix for exact match when dealing with integers and doubles. Created a new Numeric match type.
- make a copy of attributes passed in to avoid any concurrency problems. Addresses GitHub issue in Optimizely Andriod SDK.
- allow single root node for audience.conditions, typedAudience.conditions, and Experiment.audienceCombinations.
November 7th, 2018
This is the release candidate for the 3.0 SDK, which includes a number of improvements to audience targeting along with a few bug fixes.
- Support for number-valued and boolean-valued attributes. (#213)
- Support for audiences with new match conditions for attribute values, including “substring” and “exists” matches for strings; “greater than”, “less than”, exact, and “exists” matches for numbers; and “exact”, and “exists” matches for booleans.
- Built-in datafile version compatibility checks so that SDKs will not initialize with a newer datafile it is not compatible with. (#209)
- Audience combinations within an experiment are unofficially supported in this release.
- Previously, notification listeners filtered non-string attribute values from the data passed to registered listeners. To support our growing list of supported attribute values, we’ve changed this behavior. Notification listeners will now post any value type passed as an attribute. Therefore, the interface of the notification listeners has changed to accept a
Map<String, ?>
. - Update to use Java 1.7 (#208)
- refactor: Performance improvements for JacksonConfigParser (#209)
- refactor: typeAudience.combinations will not be string encoded like audience.combinations. To handle this we created a new parsing type TypedAudience.
- fix for exact match when dealing with integers and doubles. Created a new Numeric match type.
- make a copy of attributes passed in to avoid any concurrency problems. Addresses GitHub issue in Optimizely Andriod SDK.
October 10th, 2018
This is the alpha release of the 3.0 SDK, which includes a number of improvements to audience targeting along with a few bug fixes.
- Support for number-valued and boolean-valued attributes. (#213)
- Support for audiences with new match conditions for attribute values, including “substring” and “exists” matches for strings; “greater than”, “less than”, exact, and “exists” matches for numbers; and “exact”, and “exists” matches for booleans.
- Built-in datafile version compatibility checks so that SDKs will not initialize with a newer datafile it is not compatible with. (#209)
- Previously, notification listeners filtered non-string attribute values from the data passed to registered listeners. To support our growing list of supported attribute values, we’ve changed this behavior. Notification listeners will now post any value type passed as an attribute. Therefore, the interface of the notification listeners has changed to accept a
Map<String, ?>
. - Update to use Java 1.7 (#208)
- refactor: Performance improvements for JacksonConfigParser (#209)
September 21st, 2018
- fix(attributes): Filters out attributes with null values from the event payload (#204)
August 1st, 2018
- Move serialization to LogEvent.getBody() to improve performance of API calls (#201)
June 19th, 2018
This is a patch release of the Optimizely SDK for 2.1.0 which is a major release.
- Send impression event for Feature Test with Feature disabled (#193)
June 19th, 2018
This is a patch release of the Optimizely SDK for 2.0.0 which is a major release.
- Send impression event for Feature Test with Feature disabled (#193)
June 15th, 2018
- Introduces support for bot filtering.
April 25th, 2018
This is a patch release of the Optimizely SDK for 2.0.0 which is a major release.
- Checking for invalid variables passed into getEnabledFeature, Activate, getVariation and track.
April 12th, 2018
This major release of the Optimizely SDK introduces APIs for Feature Management. It also introduces some breaking changes listed below.
- Introduces the
isFeatureEnabled
API to determine whether to show a feature to a user or not.
Boolean enabled = optimizelyClient.isFeatureEnabled("my_feature_key", "user_1", userAttributes);
- You can also get all the enabled features for the user by calling the following method which returns a list of strings representing the feature keys:
ArrayList<String> enabledFeatures = optimizelyClient.getEnabledFeatures("user_1", userAttributes);
- Introduces Feature Variables to configure or parameterize your feature. There are four variable types:
Integer
,String
,Double
,Boolean
.
String stringVariable = optimizelyClient.getFeatureVariableString("my_feature_key", "string_variable_key", "user_1");
Integer integerVariable = optimizelyClient.getFeatureVariableInteger("my_feature_key", "integer_variable_key", "user_1");
Double doubleVariable = optimizelyClient.getFeatureVariableDouble("my_feature_key", "double_variable_key", "user_1");
Boolean booleanVariable = optimizelyClient.getFeatureVariableBoolean("my_feature_key", "boolean_variable_key", "user_1");
- The
track
API with revenue value as a stand-alone parameter has been removed. The revenue value should be passed in as an entry of the event tags map. The key for the revenue tag isrevenue
and will be treated by Optimizely as the key for analyzing revenue data in results.
Map<String, Object> eventTags = new HashMap<String, Object>();
// reserved "revenue" tag
eventTags.put("revenue", 6432);
optimizelyClient.track("event_key", "user_id", userAttributes, eventTags);
- We have removed deprecated classes with the
NotificationBroadcaster
in favor of the new API with theNotificationCenter
. We have streamlined the API so that it is easily usable with Java Lambdas in Java 1.8+. We have also added some convenience methods to add these listeners. Finally, some of the API names have changed slightly (e.g.clearAllNotifications()
is nowclearAllNotificationListeners()
)
March 29th, 2018
This major release of the Optimizely SDK introduces APIs for Feature Management. It also introduces some breaking changes listed below.
- Introduces the
isFeatureEnabled
API to determine whether to show a feature to a user or not.
Boolean enabled = optimizelyClient.isFeatureEnabled("my_feature_key", "user_1", userAttributes);
- You can also get all the enabled features for the user by calling the following method which returns a list of strings representing the feature keys:
ArrayList<String> enabledFeatures = optimizelyClient.getEnabledFeatures("user_1", userAttributes);
- Introduces Feature Variables to configure or parameterize your feature. There are four variable types:
Integer
,String
,Double
,Boolean
.
String stringVariable = optimizelyClient.getFeatureVariableString("my_feature_key", "string_variable_key", "user_1");
Integer integerVariable = optimizelyClient.getFeatureVariableInteger("my_feature_key", "integer_variable_key", "user_1");
Double doubleVariable = optimizelyClient.getFeatureVariableDouble("my_feature_key", "double_variable_key", "user_1");
Boolean booleanVariable = optimizelyClient.getFeatureVariableBoolean("my_feature_key", "boolean_variable_key", "user_1");
- The
track
API with revenue value as a stand-alone parameter has been removed. The revenue value should be passed in as an entry of the event tags map. The key for the revenue tag isrevenue
and will be treated by Optimizely as the key for analyzing revenue data in results.
Map<String, Object> eventTags = new HashMap<String, Object>();
// reserved "revenue" tag
eventTags.put("revenue", 6432);
optimizelyClient.track("event_key", "user_id", userAttributes, eventTags);
January 30, 2018
This release adds support for bucketing id (By passing in $opt_bucketing_id
in the attribute map to override the user id as the bucketing variable. This is useful when wanting a set of users to share the same experience such as two players in a game).
This release also deprecates the old notification broadcaster in favor of a notification center that supports a wide range of notifications. The notification listener is now registered for the specific notification type such as ACTIVATE and TRACK. This is accomplished by allowing for a variable argument call to notify (a new var arg method added to the NotificationListener). Specific abstract classes exist for the associated notification type (ActivateNotification and TrackNotification). These abstract classes enforce the strong typing that exists in Java. You may also add custom notification types and fire them through the notification center. The notification center is implemented using this var arg approach in all Optimizely SDKs.
- Added
$opt_bucketing_id
in the attribute map for overriding bucketing using the user id. It is available as a static string in DecisionService.ATTRIBUTE_BUCKETING_ID - Optimizely notification center for activate and track notifications.
January 5, 2018
This is a patch release for 2.0.0 Beta. It contains a minor bug fix.
SDK checks for null values in the Feature API parameters.
- If
isFeatureEnabled
is called with a null featureKey or a null userId, it will return false immediately. - If any of
getFeatureVariable<Type>
are called with a null featureKey, variableKey, or userId, null will be returned immediately.
December 12, 2017
This is a patch release for 1.8.0. It contains two bug fixes mentioned below.
SDK returns NullPointerException when activating with unknown attribute.
Pooled connection times out if it is idle for a long time (AsyncEventHandler's HttpClient uses PoolingHttpClientConnectionManager setting a validate interval).
October 5, 2017
This release is a second beta release supporting feature flags and rollouts. It includes all the same new features and breaking changes as the last beta release.
Fall back to default feature variable value when there is no variable usage in the variation a user is bucketed into. For more information see PR #149.
September 29, 2017
This release is a beta release supporting feature flags and rollouts.
You can now use feature flags in the Java SDK. You can experiment on features and rollout features through the Optimizely UI.
isFeatureEnabled
getFeatureVariableBoolean
getFeatureVariableDouble
getFeatureVariableInteger
getFeatureVariableString
- Remove Live Variables accessors
getVariableString
getVariableBoolean
getVariableInteger
getVariableDouble
- Remove track with revenue as a parameter. Pass the revenue value as an event tag instead
track(String, String, long)
track(String, String, Map<String, String>, long)
- We will no longer run all unit tests in travis-ci against Java 7.
We will still continue to set
sourceCompatibility
andtargetCompatibility
to 1.6 so that we build for Java 6.
August 29, 2017
This release adds support for numeric metrics and forced bucketing (in code as opposed to whitelisting via project file).
- Added
setForcedVariation
andgetForcedVariation
- Added any numeric metric to event metrics.
- Nothing breaking from 1.7.0
July 12, 2017
This release will support Android SDK release 1.4.0
- Added
UserProfileService
interface to allow for sticky bucketing
- Removed
UserProfile
interface. Replaced withUserProfileService
interface. - Removed support for v1 datafiles.
May 19, 2017
- Added
UserProfileService
interface to allow for sticky bucketing
- Removed
UserProfile
interface. Replaced withUserProfileService
interface. - Removed support for v1 datafiles.
March 17, 2017
- Add event tags to
track
API and include in the event payload - Deprecates the
eventValue
parameter from thetrack
method. Should use event tags to pass in event value instead - Gracefully handle a null attributes parameter
- Gracefully handle a null/empty datafile when using the Gson parser
February 16, 2017
- Support Android TV SDK client engine
February 1, 2017
- Default
null
status in datafile toNot started
January 31, 2017
- Add
sessionId
parameter toactivate
andtrack
and include in event payload - Append datafile
revision
to event payload - Add support for "Launched" experiment status
January 17, 2017
- Add
onEventTracked
listener - Change
getVariableFloat
togetVariableDouble
- Persist experiment and variation IDs instead of keys in the
UserProfile
December 15, 2016
- Change position of
activateExperiment
parameter in the method signatures ofgetVariableString
,getVariableBoolean
,getVariableInteger
, andgetVariableFloat
- Change
UserExperimentRecord
toUserProfile
- Add support for IP anonymization
- Add
NotificationListener
for SDK events
December 8, 2016
- Add support for live variables
November 28, 2016
- Remove extraneous log message in
AsyncEventHandler
- Add
jackson-annotations
as a compiled dependency
October 5, 2016
- Gracefully handle datafile that doesn't contain required fields
October 5, 2016
- Allow for configurability of
clientEngine
andclientVersion
throughOptimizely.Builder
- Remove ppid query string from V1 events
October 3, 2016
- Introduce support for Full Stack projects in Optimizely X with no breaking changes from previous version
- Update whitelisting to take precedence over audience condition evaluation
- Introduce more graceful exception handling in instantiation and core methods
September 19, 2016
- Add support for v2 backend endpoint and datafile
August 29, 2016
- Add a
UserExperimentRecord
interface- Implementors will get a chance to save and restore activations during bucketing
- Can be used to make bucketing persistent or to keep a bucketing history
- Pass implementations to
Optimizely.Builder#withUserExperimentRecord(UserExperimentRecord)
when creatingOptimizely
instances
July 26, 2016
- Beta release of the Java SDK for server-side testing