Hi there , I want to ask about Ga4 destination, ...
# support
l
Hi there , I want to ask about Ga4 destination, we found that the Anonymous id will be send to user id of GA4? it seems a bug for GA4, is there any way can we avoid it, and will only send User- id when we identify our users?
g
Are you sending events in Cloud mode or Device mode?
l
Device Mode
@gentle-petabyte-80785 any updates or this problem?
f
Hey, @lively-airline-84487 we need to verify this first then we can confirm.
l
Thanks
s
Wished to add +1 to this question. I'm also doing GA4 integration via RudderStack and ran across anon_id being sent as user_id to GA4. Looks like a bug to me as well and would love to only send user_id for identified users and not for anon users. I'm fairly sure the current setting will force GA4 to interpret the events before and after user identification as belonging to two different users.
g
@shy-kite-21035 can you please look into this as well
s
Thank you! I think this line here makes GA4 device mode initialize with anon_id set as GA4 user_id for non-identified users https://github.com/rudderlabs/rudder-sdk-js/blob/production-staging/src/integrations/GA4/browser.js#L69 There is a similar statement in the
identify
call as well, though I guess the RudderStack userId will always exist in that case? https://github.com/rudderlabs/rudder-sdk-js/blob/production-staging/src/integrations/GA4/browser.js#L190
@shy-kite-21035 Any updates here?
l
@shy-kite-21035 @gentle-petabyte-80785 Any updates ?