Hi all. I have a question about `anonymous_id`. Ho...
# ask-questions
n
Hi all. I have a question about
anonymous_id
. How to use it correctly? • For example, if I have an
orders
table and I build metrics based on it. • Do I need to store both
anonymous_id
and
user_id
in
orders
and the same fields in
viewed_experiments
? • Then add
anonymous_id
as Identifier in GB and select
ananoymous_id
from
orders
table in my sql metric? • And if the
anonymous_id
from
orders
and
viewed_experiments
match, then I will get a conversion, right? • What if a user from the orders table was previously assigned to a different option? For example, if I have this records in my database:
Copy code
ORDERS TABLE (id, user_id, anonymous_id, timestamp)
1, 1, anon1, 2023-01-01 (the user id was known at the time of creation)
2, 1, anon2, 2023-01-04 (user ID added to the order after user authorization)

VIEWED_EXPERIMENTS TABLE (user_id, anonymous_id, experiment_id, variation_id, timestamp)
1, anon1, experiment1, 0, 2023-01-01 (the user created the order authorized)
null, anon2, experiment1, 1, 2023-01-04 (the user created an order as an unauthorized user and ended up in another group)
What is correct way to analyze experiment in such situation?
h
What is your experiment going to be randomized on? the anonymous_id?