Optimizely在Java SDK代码中未激活。

huangapple 未分类评论43阅读模式
英文:

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&lt;String, Object&gt; attributes = new HashMap&lt;&gt;();
attributes.put(&quot;device&quot;, &quot;iPhone&quot;);
attributes.put(&quot;lifetime&quot;, 24738388);
attributes.put(&quot;is_logged_in&quot;, true);

Boolean enabled = optimizelyClient.isFeatureEnabled(&quot;new_feature&quot;, &quot;user123&quot;, 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

huangapple
  • 本文由 发表于 2020年7月25日 07:46:01
  • 转载请务必保留本文链接:https://java.coder-hub.com/63082814.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定