https://www.growthbook.io/ logo
#announcements
Title
# announcements
p

prehistoric-ram-61825

09/20/2023, 7:13 AM
Hi, I am trying to setup experiment with GrowthBook. I have setup an experiment https://app.growthbook.io/experiment/exp_19g61tlmreelej When I try to fetch the value in my test, it always return the same value. Is it because I did not set a user ID with GrowthBook yet? would all the anonymous user always get the same value in experiment?
w

white-fireman-22476

09/20/2023, 7:24 AM
Yes. Growthbook hashes based upon the assignment attribute and the feature key. If you don't change the assignment attribute ever then the hash will be the same and it will get the same value.
p

prehistoric-ram-61825

09/20/2023, 7:28 AM
what would be the suggested way for me to handle anonymous user? We have a large amount of pages that user will stay anonymous
and when user eventually logged in and have a user id, would the value be switched to another value after I submit their ID?
w

white-fireman-22476

09/20/2023, 7:29 AM
You should target your experiment then to an anonymous id
p

prehistoric-ram-61825

09/20/2023, 7:30 AM
would that be deviceId?
w

white-fireman-22476

09/20/2023, 7:30 AM
for GA4? Yes.
p

prehistoric-ram-61825

09/20/2023, 7:31 AM
Sorry I was referring deviceId in here
w

white-fireman-22476

09/20/2023, 7:31 AM
You can check out your datasource page to see if both anonymous_id and user_id have been set up.
Yes device_id should be the anonymous one.
It will then stay consistent between the logged in and logged out cases.
p

prehistoric-ram-61825

09/20/2023, 7:33 AM
Thanks, that sounds like the plan
I do not have data sources set up yet
would the experiment splitting work on its own?
w

white-fireman-22476

09/20/2023, 7:34 AM
Yes as long as that attribute gets set when Growthbook gets instantiated.
p

prehistoric-ram-61825

09/20/2023, 7:36 AM
I see, so I will have to set it, otherwise it will not work? I was using google optimize and they set one on their own
w

white-fireman-22476

09/20/2023, 7:37 AM
There is a video here that explains moving over from google optimize: https://docs.growthbook.io/guide/GA4-google-analytics
3 Views