How do folks typically handle Segment setting `ajs...
# ask-questions
How do folks typically handle Segment setting
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.
I suggest using the ready event to update the attributes within GrowthBook.
something like:
Copy code
analytics.ready(function() {
    id: analytics.user().anonymousId();
Fantastic, will give this a go. Thanks Graham!