Analytics
2.3K members online now
Discuss regaining access to Analytics accounts, restoring accounts, changing user access levels, and navigating the homepage
 
Guide Me
star_border
Reply

How to track User Location by User ID Tracking

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello Friends 

 

i want to track my user location by user ID, we have already setup backed unique user ID for each user but now i want to track each user date by Google Analytics 

 

i have done some R&D about user id tracking but still confuse how to use id, kindly check below URL for that 

 

https://developers.google.com/analytics/devguides/collection/analyticsjs/cookies-user-id#user_id

 

https://www.youtube.com/watch?v=tjY_ZmSRW4o

 

Can you please guide me how to created custom code and add my website for track user ID 

 

 

1 Expert replyverified_user

Re: How to track User Location by User ID Tracking

Rising Star
# 2
Rising Star
Hi Amit,

For user ID, you need to pass a unique value when the person logs-in. Sounds like you already have a unique id for your users so you simply need to do the lookup upon log in and pass it into the GATC (Google Analytics Tracking Code) as specified in the link you provided. If you are using GTM, you can pass into the dataLayer and use a dataLayer variableYou also need to create a user id view to get any cross device behavior.

https://support.google.com/analytics/answer/3123666?hl=en

Hope that helps.

Best,

Theo Bennett
Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

Re: How to track User Location by User ID Tracking

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Thanks Bennett for replay

i have already seen above URL but don;t know about code

can you provide me example for code, which i will need add in my website and anything else done in Google analytic

Re: How to track User Location by User ID Tracking

Rising Star
# 4
Rising Star
Hi Amit,

There are thousands of ways to do this but the bottom line is that it's specific to your systems and platforms. A developer will need to look up and pull the information from your backend (I think you said you had unique id's) adn dynamically place the information in the GATC or place it in the dataLayer for Google Tag Manager.

Unfortunately it's not like ticking a checkbox etc. and you get the data; in most cases it's custom development work.

Best,

Theo Bennett
Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

Re: How to track User Location by User ID Tracking

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
Thanks Bennett For Reply

let me know more R&D on it but if you will find any example code then please share with me