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

happy-intern-85510

02/29/2024, 4:25 PM
Hey @fresh-football-47124 - I've been really struggling for about a week to understand how Assignment Queries work with React and GA4. What would really help in the documents is a full example of #1 a specific Tracking Callback, that matches with #2 the Assignment Query, and #3 how those tables look in Big Query. I'm attaching screenshots of my project which is here. https://devadmission.themobmuseum.org/ 1. I'm confused about where the Identifier type should be represented in the assignment query, and in the tracking callback. 2. Should we be passing the "user_id" in both the tracking callback AND in the growth book attributes, or does it only need to be done once? 3. I have 2 Big Query screenshots, because I have a pseudo_users_id table that is OUTSIDE the events table. I also have one inside. Did I mess things up with my tracking callback to make that happen? Which one should I be using? I've tried so many different things I'm worried I'm junking up the data. 4. Also if we didn't select "stream live events" and Big Query pushes data to GA4 only once per day. Do I need to wait the whole day to see if my changes are working every time I adjust the tracking callback and visit the site? 5. Also our site doesn't have any logged in users, so it would be great if we could see an example that was really simple. If there was any way we could look at this on a ten minute screenshare, I would be eternally grateful.
f

fresh-football-47124

02/29/2024, 4:27 PM
Hi Joe - it looks like the assignment query you have is mapping that psudeo id to 'id'
but it would see you have two randomization units defined for that data source (and metrics)
if you are okay using psudeo id as the 'id', you can remove the assignment query for 'anonymous_id' and then change the randomization units for the metrics and the experiments
h

happy-intern-85510

02/29/2024, 4:37 PM
I'm happy to use pseudo id as the 'id'. So I should #1 Delete the anonymous id assignment query What should I select as the identifier type for the logged in user assignment query? How should I adjust the Select statement so that it matches my tracking callback and Big Query data?
f

fresh-football-47124

02/29/2024, 4:43 PM
You can customize it to however you like - but making it make logical sense would be best
so GA4 has the psudeo id by default
you could call that whatever you like, but anonymous_id make sense.
Do you have logged in users?
google also has 'client_id' which can be used as an identifier
typically we see those two used
whatever you set for the idenfiter in the data source within GrowthBook should match what data you're passing in the SDK implementation
(as well as your SQL query)
h

happy-intern-85510

02/29/2024, 4:54 PM
We don't have any logged in users. 1. I'm changing my identifier in the assignment query to anonymous_id. 2. I'm changing my tracking callback and growthbook attributes in the SDK to anoymous_id to match. So then should my select statement be "anonymous_id as pseudo_id" or is that backwards, should it be "pseudo_id as anonymous_id"?
f

fresh-football-47124

02/29/2024, 4:59 PM
so to be clear
you can have a different assignment identifier from the analysis identifier
so you can use the client_id for assignment, and the psudeo id for reporting - and there should be a 1:1 mapping between the two - and you'll know you have a problem with it when you get multiple exposure warnings in the experiment
(I mention this, as I'm not sure google exposes the psudeo id client side for web - and it might be the same as client_id, though I'm not sure)
h

happy-intern-85510

02/29/2024, 5:26 PM
This is my adjusted query. It's not giving me an error but its not showing any data yet either. Could it be that I have to wait for Big Query to sync or should it be returning data right away?
8 Views