dazzling-quill-18166
10/04/2022, 10:11 AMguestId
and passing it to setAttributes
2. in growthbook GUI I've got 1 feature created test-feature
with override rule set to experiment
and 1 experiment corresponding with the feature
3. guestId
was generated for the user when I had traffic set to 100%
and traffic split set to old-view: 1
and new-view: 0
4. After some tests I wanted to manipulate traffic split
parameters so that I put 100%
to old-view: 0
and new-view: 1
5. Unfortunately for the same guestId
I'm still receiving old-view
variation
My question is whether this behaviour is expected according to this piece of documentation
In the vast majority of cases, you want to split traffic based on either a logged-in user id or some sort of anonymous identifier like a device id or session cookie. As long as the user has the same value for this attribute, they will always get assigned the same variation.
Only if I delete guestId
and generate new one it seems that I receive proper variation.
Thanks for your answer.future-teacher-7046
dazzling-quill-18166
10/04/2022, 10:19 AMsetAttributes
. id is being generated with the use of this formula
[...Array(30)].map(() => Math.random().toString(36)[2]).join("")
future-teacher-7046
dazzling-quill-18166
10/04/2022, 10:23 AMgrowthbook.setAttributes({
"id": Cookies.get('guestId'),
"loggedIn": true,
"deviceId": "abcdef123456",
"employee": true,
"company": "acme",
"country": "US",
"browser": navigator.userAgent,
"url": router.pathname,
})
id
future-teacher-7046
growthbook.evalFeature("test-feature")
Specifically the "source" property of the returned object.dazzling-quill-18166
10/04/2022, 10:30 AMfuture-teacher-7046
dazzling-quill-18166
10/04/2022, 10:39 AMguestId
future-teacher-7046
dazzling-quill-18166
10/04/2022, 11:28 AMtraffic split
Im getting variationId = 0
when triggering growthBook.evalFeature('test-feature')
guestId
from cookies
so that my script can assign a new one