Analytics
3.7K members online now
3.7K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

userId was set; but authenticated user is NOT catpured

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I have userId set, but why does GA not track the user?

 

 CuBWarsWEAAGNkz

1 Expert replyverified_user

userId was set; but authenticated user is NOT catpured

Top Contributor
# 2
Top Contributor

Hi @Fan Y It seems as the userId is set after the hit is sent and userId needs to be sent with an existing hit so (a simplified version):

ga('create', 'UA-XXXXX-Y', 'auto');

ga('set', 'userId', USER_ID);
ga('send', 'pageview');

 

Hope it helps.

 

Kind regards,

Zorin

 

Web analyst @ escapestudio.net

Re: userId was set; but authenticated user is NOT catpured

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Yes, it works!