英文:
Optimizely not getting activated for Java SDK code
问题
我正在尝试使用来自Optimizely文档的以下代码:
Map<String, Object> attributes = new HashMap<>();
attributes.put("device", "iPhone");
attributes.put("lifetime", 24738388);
attributes.put("is_logged_in", true);
Boolean enabled = optimizelyClient.isFeatureEnabled("new_feature", "user123", attributes);
在optimizely api中,我已经设置了实验为"new_feature",变体密钥为"var1",并且使用上述属性对受众进行定向。我已经将"user123"加入了白名单。但我认为我的实验没有被激活,也没有收到任何流量。我是否遗漏了什么?是否有任何提示可以帮助我?
英文:
I'm trying to use the below code from the Optimizely docs :
Map<String, Object> attributes = new HashMap<>();
attributes.put("device", "iPhone");
attributes.put("lifetime", 24738388);
attributes.put("is_logged_in", true);
Boolean enabled = optimizelyClient.isFeatureEnabled("new_feature", "user123", attributes);
In the optimizely api , I have the experiment setup as "new_feature" with variation key as "var1" and user attributes for audience targeting with those above attributes. I have whitelisted the user123. But I don't think my experiment is getting activated or receiving any traffic. Am I missing anything here? Any hints are helpful?
答案1
得分: 0
isFeaturerEnabled
是用于功能标志的 API。
您可以将实验设置为独立对象,也可以将实验设置为功能标志上的实验。
如果您只想为独立实验激活用户,您将使用 activate(experimentKey, userID)
。
如果您想要为功能标志上的实验激活用户,您可以像现在这样使用 isFeatureEnabled
。
有关激活 API 的更详细信息,请参见此处。
英文:
isFeaturerEnabled
is the API for feature flags.
You can set up experiments as standalone objects or as experiments on feature flags.
If you only want to activate a user for a standalone experiment, you will use activate(experimentKey, userID)
.
If you want to activate a user for an experiment on a feature flag, you can use isFeatureEnabled
like you are now.
More in depth information on activate API here
专注分享java语言的经验与见解,让所有开发者获益!
评论