This message was deleted.
# ask-questions
w
This message was deleted.
f
The assigned value for the user should change id you change the traffic split like that. The quote from the docs is only true if the traffic split remains the same.
What code are you using to pass the guestId into the SDK?
d
Im passing guestId via
setAttributes
. id is being generated with the use of this formula
Copy code
[...Array(30)].map(() => Math.random().toString(36)[2]).join("")
then Im putting it into cookie
f
When you do setAttributes, are you calling it "guestId" or just "id"?
d
Copy code
growthbook.setAttributes({
      "id": Cookies.get('guestId'),
      "loggedIn": true,
      "deviceId": "abcdef123456",
      "employee": true,
      "company": "acme",
      "country": "US",
      "browser": navigator.userAgent,
      "url": router.pathname,
    })
im calling it like in the docs
id
f
Ok. And what is returned if you do
Copy code
growthbook.evalFeature("test-feature")
Specifically the "source" property of the returned object.
That looks correct. You are assigning 100% of traffic to the first variation (true). And that is what the user is being assigned.
d
Okey thanks for letting me know that this is fine. Can u consider this example? I just flipped traffic for the same example as we're discussing.
and somehow im still getting `new-view``
I did not change/remove existing
guestId
f
You were getting variation id 0 before, but are now getting variation id 1, so it seems to be working.
d
It looks like I've got something wrong
no matter if I change
traffic split
Im getting
variationId = 0
when triggering
growthBook.evalFeature('test-feature')
I get what I want when I remove
guestId
from
cookies
so that my script can assign a new one
143 Views