Regarding this statement in the FAQ: "If your appl...
# ask-questions
w
Regarding this statement in the FAQ: "If your application only has anonymous users (e.g. a static marketing site), then we recommend a single
id
attribute which, similar to
deviceId
or
sessionId
above, is a random hash persisted in a cookie or local storage." This means that I have to send the ID from each user and store it in a cookie or local storage in the user's device? Otherwise, the same user may become part of control and variation? I'm not a dev and I'm learning how to use GB. Thanks! 🙂
r
Hi there! In general, yes, you need to provide some kind of ID to ensure users are bucketed the same way every time. However, depending on your experiment implementation, GB may handle this for you. How are you planning to run experiments on your site?
w
@strong-mouse-55694 if GB can do it for us that would be way better. We want to start launching split url tests and then most likely will continue with non-split url tests. We'll use the react sdk. Is there any other info you need? Thank you!
s
It was mainly about which sdk you're using. With React, are you using Next or something else?
w
@strong-mouse-55694 I'm also curious on why we need to send the url as a param, can't GB get the URL by itself?
I believe we're using Next and some other language too, not sure but I can ask
s
With Next/React, you do need to set up an ID, but we have some examples of how to do it: https://github.com/growthbook/examples/blob/main/next-js/src/middleware.ts
👍 1
What do you mean about sending the url as a param?
w
@strong-mouse-55694 I saw that "url" is an attribute in the GB guide: growthbook.setAttributes({ 2 "id": "foo", 3 "url": "foo", 4 "path": "foo", 5 "host": "foo", 6 "query": "foo", 7 "deviceType": "desktop", 8 "browser": "chrome", 9 "utmSource": "foo", 10 "utmMedium": "foo", 11 "utmCampaign": "foo", 12 "utmTerm": "foo", 13 "utmContent": "foo" 14}); So my question is, why does it exists? Shouldn't GB be able to get it from the user browser?
f
For some SDKs we will populate some attributes, but generally we built GrowthBook to be very flexible, and don't make too many assumptions as to how you want to use it
👍 1