https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
h

handsome-answer-25651

11/22/2021, 4:05 PM
I have a question that is somehow related to the one asked above. I wonder how do I make sure that same experiment variant is shown to the same user upon future sessions, and also to the same user after they signup? If I understand correctly this is what the
Copy code
user: { id: "123" },
is for in the quick usage example here https://docs.growthbook.io/lib/js I am using mixpanel so I am thinking of somehow accessing its distinct_id as it should be automatically merged to id cluster after signup. However, i am not sure how to access it. It seems like bread and butter of experiments so I bet someone will have an idea how to go about it. Thanks in advance! 🙂
f

future-teacher-7046

11/22/2021, 4:20 PM
Our SDKs do not persist variation assignments. We use deterministic hashing instead. Because of this, Mixpanel's distinct id might not fully work how you are expecting since if the user logs in on a different device, they will get a new distinct id generated, which may result in them seeing a different variation. Unfortunately, there's no perfect solution right now. You can either use long-lived anonymous device ids (like Mixpanel's distinct_id) to ensure users see the same variation when logging in/out of their account. Or you can use a logged-in user id to ensure users see the same variation if they log into their account on different devices (or clear cookies), but that means logged-out users won't be included in the experiment at all.
h

handsome-answer-25651

11/22/2021, 6:02 PM
Thanks a lot. I need to include logged out users, I will try using device ids then
16 Views