optimizely/java-sdk

Disabled features are sending impressions

fr-ct opened this issue · 3 comments

fr-ct commented

We are using this library to integrate with Optimizely and we have a lot of A/B tests that are not enabled.

That is causing too many impressions from us which are not real since the features are not enabled.
It seems like this is known from the commend on this line

* TODO revisit this method. Calling this as-is can dramatically increase visitor impression counts.

So, in here

The code is sending an impression and later down the line is checking if it is enabled or not

if (featureDecision.variation.getFeatureEnabled()) {

@fr-ct If a feature is part of an experiment, then there is an impression when evaluated in a test since the test covers enabled and disabled. If the test is archived/off, then no impression is sent because the experiment is not part of the configuration. This is as designed and not a bug.
Rollouts on the other hand do not create impressions. I hope this helps.

fr-ct commented

@thomaszurkan-optimizely thanks for the quick reply ... I actually spent some time looking into this and I guess I didn't express myself well. Actually I incorrectly described the problem.

The main problem we have is that whenever a user visit one page, we do a getEnabledFeatures() and that will return all enabled features in our account... but even if that feature is not used in that page, and is enabled, the SDK is sending an impression

This was technically expected behavior, but closing this out now that we've introduced the new decideAll() API which supports a parameter (DISABLE_DECISION_EVENT) to suppress decision events out of the box.

To use this effectively, you will still need to re-invoke .decide() for your individual features later in the app lifecycle when users are exposed to the feature or experiments in order to have the experiment decisions be recorded and results to be captured properly, but this should be doable without SDK overrides more effectively now.