Generating player's id

Hi folks, I want to get player’s id and store it in a variable so then in Google Analytics I can see metrics per player… what’s the best way to do it? I have FireBase set up already.

My main issue is how to generate player’s id and store it in a variable.

Below is what I’ve got so far but I’m open to fresh solution as this returns player’s id as 0.

Hi - i’ve only done this once! - and I didn’t use analytics! but nobody else is commenting here so…
You’re doing things differently to how i did it.
I think what you’re not doing that i did (based on the tutorials that i watched alex’s and gemdev if i remember right!?) is to create a document with the uid which then contains their data (see image)
instead you’re setting user’s id to the global variable retrieved from storage.
Whether what you’re doing creates a unique profile - I don’t know - I faffed about with firebase for longer than was enjoyable!
Screenshot 2025-10-18 061728

1 Like

thanks @petlimpet ! so it turns out the set up was correct, I was unnecesarily wrapping the player id and session id with VariableString() which was causing it to return 0. now all working well, thanks for your time!

1 Like