google-analyticsgoogle-tag-managerevent-trackinghotjar

Google Tag Manager - user_id variable


What is the best way to keep track of user_id? I need to send Hotjar user_id so I can keep track users and segment based on their behavior. I'd prefer not to contact devs to implement a dataLayer push, but I would like to do it using already existing parameters in GMT.

My solution is to use cid as a variable that I would send Hotjar. Is this a good way to do it or is there a better way? Does cid remain unchanged until cookies are deleted?

For clarity, I am referring to the cid parameter that is a part of each GA event. I am curious if it is reliable enough to put it in a variable and send to Hotjar as user_id.


Solution

  • Yes, just use cid. It's persistent enough to identify a user pretty accurately. You can get it from your _ga cookie.