late-teacher-86348
08/25/2022, 4:29 PMlate-teacher-86348
08/25/2022, 4:35 PMuser_id_or_anonymous_id
attribute/identifier – user_id
if they're logged-in and falling back to anonymous_id
if they're not.
That felt a little hacky though, and we wanted some reassurance!future-teacher-7046
user_id_or_anonymous_id
will cause users to potentially switch variations when they log in.
Our recommended approach is to pick just one identifier type for each experiment. Depending on the specific experiment, you might pick user_id
or anonymous_id
.
As a general rule of thumb, if the test is shown primarily to only logged-in users, then pick user_id
. Otherwise, pick anonymous_id
.
If a test has a large amount of both logged-in and anonymous users, I would usually just use anonymous_id
to split traffic. Users who switch devices or clear cookies may see multiple variations, but for most tests and products, that should be a relatively small percent of users and unless it's something super critical like pricing, not a huge deal if a few people see both variations.late-teacher-86348
08/25/2022, 7:41 PM