adorable-solstice-28735
07/14/2023, 5:50 PMfresh-football-47124
adorable-solstice-28735
07/17/2023, 3:27 PMuseEffect(() => {
// Load all experiments and variants
gb.loadFeatures({ autoRefresh: true, timeout: 2000 })
// Set user attributes for targeting (from cookie, auth system, etc.)
gb.setAttributes({
id: client_id,
url: window.location.href
});
if (expConfig.running) {
//load configured experiment
const exp = gb.run(expConfig);
if (exp.value === expConfig.variations[0]) { //always a control
dispatch(bootOptimize( {enableExperiment: false }));
console.log(`exp variant - ${expConfig.variations[0]}`);
}
if (exp.value === expConfig.variations[1]) {
dispatch(bootOptimize( {enableExperiment: true }));
console.log(`exp variant - ${expConfig.variations[1]}`);
}
}
}, [])
fresh-football-47124
adorable-solstice-28735
07/18/2023, 2:22 AM