faint-portugal-8257
04/14/2022, 1:44 PMajs_anaonymous_id
and the growthbook id attribute in the growthbook react SDK? We're loading both libraries as part of our NextJS app, and there appears to be a race condition in the segment sdk and growthbook initializing for first time visitors. It takes some time for the anonymous id to be generated, so we've been manually generating one at the time of the Growthbook initialization to make sure it's set, and then setting the anonymous id manually for analytics.js as well.fresh-football-47124
analytics.ready(function() {
growthbook.setAttributes({
...growthbook.getAttributes(),
id: analytics.user().anonymousId();
});
});
faint-portugal-8257
04/15/2022, 11:47 AM