Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

用户稳定进入灰度组,前端如何实现 #36

Closed
Yill625 opened this issue Feb 21, 2024 · 3 comments
Closed

用户稳定进入灰度组,前端如何实现 #36

Yill625 opened this issue Feb 21, 2024 · 3 comments

Comments

@Yill625
Copy link

Yill625 commented Feb 21, 2024

用户稳定进入灰度组文档

只提供了后端方式

const user = new featureProbe.FPUser().stableRollout(i.toString());
const isOpen = fpClient.booleanValue(YOUR_TOGGLE_KEY, user, false);

前端尝试 boolValue 函数加第二个参数控制用户进去同一组失败,刷新还是按照流量随机进入A/B组

image

2024-02-21 19 25 06

@Yill625 Yill625 changed the title 用户稳定进入灰度组,前端react-sdk失效 用户稳定进入灰度组,前端如何实现 Feb 21, 2024
@frankzhaopeng
Copy link
Member

在初始化react sdk的时候传入的user对象,通过new FPUser方法初始化时,可以传入你代码中从cookie中获取的uid。
const uid = xxx;
const user = new FPUser(user);
这样user会稳定进入一个实验组。
另外,boolValue的第二个参数是获取开关时的默认返回值,不能用于设置user变量。
具体可参考js sdk的api:https://featureprobe.github.io/client-sdk-js/index.html

@Yill625
Copy link
Author

Yill625 commented Feb 22, 2024

@frankzhaopeng 感谢,这个已经解决了。
这边还有一个问题:指标分析没有接收到数据
image

但是在H5已经看到接口有传递自定义事件了
image

image 打开事件追踪器,可以看到开关事件是已经生效的了,但是指标事件并没有数据 image

@frankzhaopeng
Copy link
Member

目前SaaS服务不再维护,请自己搭建服务使用该功能。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants