Markus Mueller
Markus Mueller

Reputation: 35

Google Analytics User-ID | Value for singed out users

I integrated the Google Analytics User-ID feature on our website today (in combination with Google Tag Manager). It's working great for logged in users.

I use the UID of our system for logged in users.

Logged in user example

However, I am not sure which value has to be used for users that are not logged in.

Currently, it's just blank if the userId value can not be set because the user is not logged in yet.

Logged out user example

Is it okay if its just blank? Or do I have to set the value to something specific?

I thought about:

But I just don't know which what the correct thing to do is here. I can't find a clear answer to this online, and the Google Guides and Documentations don't expressively say anything about it either that I've seen.

I would really appreciate any help with this. And thank you in advance for your suggestions and answers!

Cheers!

Upvotes: 1

Views: 2033

Answers (1)

faridghar
faridghar

Reputation: 1515

When a user is logged out, you should just totally skip pushing the userId onto the dataLayer. In this case, the GTM userId variable will resolve to undefined (because it will not find such a key on the dataLayer) and Google Analytics will ignore it altogether and the &uid query parameter will not be sent to GA.

Upvotes: 3

Related Questions