https://www.growthbook.io/ logo
s

straight-dog-45711

08/17/2023, 12:55 AM
Hey All, also new to growth book and have an existential question. Let's say we're assigning experiments on our marketing site which runs client side segment code thus always has anonymous ID / user ID values. If we want to create a metric from a table where anonymous ID's aren't stored (like an orders table), can you get away with just using a user id or do you have to create some sort of a mapping where you can pull anonymous id as a column for the metric query?
f

fresh-football-47124

08/17/2023, 12:56 AM
I assume that all ‘orders’ have a user_id? If you have some way to map or join between the two, you can use metrics assigned to either
s

straight-dog-45711

08/17/2023, 12:56 AM
yeah correct, it does - just not an anonymous ID col. the user id's map just fine. just wondering if growthbook always expects the anonymous id col
f

fresh-football-47124

08/17/2023, 12:57 AM
for each metric, you can define which identifiers it has
then, if you define the mappings between any identifiers, you can use them transparently, and GrowthBook will do the joining for you
s

straight-dog-45711

08/17/2023, 12:59 AM
awesome. so essentially, I can just remove anonymous id like so and it should work?
f

fresh-football-47124

08/17/2023, 12:59 AM
correct
if you click ‘edit SQL’ it will tell you what values are required to be returned
s

straight-dog-45711

08/17/2023, 1:00 AM
amazing. great product btw! very cool to have co-founders so active!
f

fresh-football-47124

08/17/2023, 1:00 AM
thanks
s

straight-dog-45711

08/21/2023, 9:16 PM
quick follow up question here. Was able to setup the metric I wanted which is a duration metric on the orders table from our warehouse, however, I can't see the metric as being available for the experiment we want to add it to. In the experiment in question, we're using a different data source to do experiment assignment. Is that the reason why the metric wouldn't be available on this particular experiment or is there a different reason I should look into?
f

fresh-football-47124

08/23/2023, 11:15 PM
The metrics are joined to the database they are pulled from
when you set up the experiment, you choose the database to pull exposure information from, and the metric set is limited to this data source as well