sparse-island-75978
08/28/2023, 2:30 PMagreeable-notebook-26033
08/28/2023, 5:24 PMsparse-island-75978
08/29/2023, 8:08 AMwindow.gtag("event", "experiment_viewed", {
event_category: "experiment",
experiment_id: experiment.key,
variation_id: result.variationId,
growthbook_user_id: RANDOM_HASH,
})
white-fireman-22476
08/29/2023, 8:18 AMSELECT growthbook_user_id, ... FROM ... WHERE ... AND growthbook_user_id is not null
sparse-island-75978
08/29/2023, 8:21 AMwhite-fireman-22476
08/29/2023, 8:21 AMsparse-island-75978
08/29/2023, 8:22 AMwhite-fireman-22476
08/29/2023, 8:23 AMsparse-island-75978
08/29/2023, 8:24 AMwhite-fireman-22476
08/29/2023, 8:27 AMuser_pseudo_id
is I believe pretty much doing the same thing.sparse-island-75978
08/29/2023, 8:31 AMuser_pseudo_id
stored in _ga
cookie?user_pseudo_id
and use it instead of hash when user is logged out. If user is logged out and cookie doesn’t exist then we can generate random hashuser_pseudo_id
from ga and pass to Growthbook attributes otherwisewhite-fireman-22476
08/29/2023, 8:53 AMAll events that are generated for a user (with a User ID or not) will include a "user pseudo ID" (sometimes this is displayed as the "Device ID" or "App-Instance ID" in reports). On the web, this is supplied by a first-party cookie, and was known as the "client ID" in previous versions of Google Analytics. For Android and iOS apps, this is set to the App-Instance ID.
sparse-island-75978
08/29/2023, 3:45 PMdeviceId
attribute to decide which variation should be assigned. So I can safely use user_id
for logged in users as id
attribute in growthbook instance. But here comes the question - should I set it to null
/ 'guest'
when user is logged out? And should it be always exactly same as userId
custom dimension set in GA4?deviceId
? Can I use deviceId
itself as id
attribute when user is logged out?white-fireman-22476
08/29/2023, 3:54 PM