This has been helpful in so many ways. Definitely covers a lot more than all the other resources on the web, and that too in a very short tutorial. Thank you so much!
Hi Julius! Thank you for the video. I have kinda stupid question but still 😅 What's use cases for user id if I don't use bigQuery? I'm mostly looking at GA4 to understand which traffic source bring more people and set up events to understand how people interact with website. How can I use user id in my favor only in GA4?
Hola Julius!! You don't idea how useful are your videos for me. Thank you!! I am straggling with the implementation of the user id, some things have changed both within GTM and GA4. For example we no longer have the User Properties in GTM so I don't know how to create the dimension. Do you know what can I do?
I heard about some disadvantages using the user ID. E.g. when a user locks out he is counted always with a new generated user ID. What is your view on that?
Hi Juluis, Will there be anything different when you are trying to do this on a Single page Web application aka PWA site. There is no container loaded on the logging in on the page.
In one of your videos, you suggested to keep this setting in GA4 config Tag "Send a page view event when this configuration loads" - OFF... But in this case of User ID tracking you are leaving this setting checked (I mean you are keeping it on). What should I do? Whether to leave it as it is or should I switch this off?
thanks. the userID has not been sent to previous sessions for the same user, is the only way to connect user to his actions before registered is to find the psuedoID and connect them in Bigquery?
Hi Julius, with new Tag Configuration, where should we add the user_id? Should it be under Configuration Settings Variable --> Configuration Parameter? Or under Shared Event Variables? Thanks for your help.
that's a great piece of information. i have a question- if a ga4 property have 3 data stream 2 for apps and 1 for website. should i implement the tracking code three time for each of the data stream?
@AnalyticsMania, do you happen to have a new version of this video? The "Fields to set" is no longer there, instead it seems to require an event to send that data over.
Thanks for your videos, they're always so informative and helpful. I'm trying to use user ID to track people who have signed up over the last year but not returned in the last 3 months. Do you know if this is possible? Thanks in advance.
Hi Julius thanks for the videos, hey I have an issue with my user id . it might contain zeros on the left like this 001234 and the zeros disappeared when inside of GA4 Custom dimension. How can I fix this ? Cheers
Massively helpful! Any issue you are aware of if we are sending user_id on a GA4 Event tag instead of setting on initial Configuration tag? This is because we only have one initial Container Load to fire Config Tag, with the login event and GA4 pageview hits sent on subsequent History Changes. Perhaps duplicating our Config Tag to fire on Container Load and subsequent Login event would solve?
Hello! Currently they've changed the the GA4 Configuration and has different options than what was shown in the video. Will there be an update video about this or can you recommend an article/tutorial which has the latest changes ?
Julius, as you know the User Properties drop down for the GA4 configuration has completely changed with Google Tag. Can you please re-do this video now that these instructions don't match?
Great video ! Thank you. I'm having an issue where all non-logged in users are getting counted as a single user with the user_id of "undefined", and my reports are off. Yet, what I read online says that it *should* be undefined. Any suggestions here would be appreciated!
in my case, container loaded events runs before my login event, and as such, I am unable to see the userid in my Google analytics. Is there a reason for this and a fix hopefully?
The fix for this was, I made sure I pushed my event before the Google tag container was declared. In essence, I wrote the code for the data layer event at the top of index.html file. Stored my user ID in local storage, that way I could retrieve it anywhere in the app.
Thanks Julius ;-) What's the best to track "login" : this one or the training one? Is there any difference of performance? The Methodology is huge because we use in one method "event" and but not in this method.
What do you mean "the training one"? The main point is to send user id with every event to GA4, regardless of how you get that id. Asking a developer to push the id is a robust option.
@@AnalyticsMania I mean the training : www.analyticsmania.com/courses/google-tag-manager-course-for-beginners/ Sorry, if I maybe did not understand the difference between the 2 methodologies
In my beginner course, I don't specifically explain user ID tracking. I just show one example of tracking a login event (but that is just to show the example of reading from the data layer, not the User ID tracking). The real method is in this youtube video (and also in the intermediate/advanced GTM course)
Hi, i have Question like in my web application. I am using SSO for login but with different domain it will create different user in analytics. also i am using same page for login in mobile application. how can i overcome that issue. any suggestion or solution you have please answer. Yes your videos are very helpful to get through GA. Thanks.
How to See other Fields with respect to user_id? For example, If I have custom dimenson like user_role , how can I map that data with the user_id? I want to visualize some other dimensions with user_id .
Hi Julius, thx for your videos. One question about userId tracking, why in my GTM at I see a null value [{name: "user_id", value: undefined}]? I have logged in and user id shows fine on dataLayer, also I have defined the custom dlv in GTM. Thanks in advance.
Hi, I've implemented user_id through GTM, and I can see that event tags and Google Tags pull user ID from the data layer, but I can't see user_id in GA4 Debug View. Any ideas for the reason? Thanks!
@@AnalyticsMania hi again! I think the issue is with the order in which my tags fire. I'm dealing with a SPA, and my Google Tag (set to Initialization - All pages) fires only once once the website loads. Once the signup or login event occurs, the page doesn't reaload, hence Google Tag doesn't fire. How can I make signup or login events (where I get my user ID) fire first? Thanks!
@@dimanikitin8278 I have the same issue, it doesn't appear in debugview, I tried everything, sequencing and ..., everything is fine in Tag manager preview, variables and event parameters are ok but in the debugview of GA4 there isn't any sign of user id
Great video Julius! are you 100% sure it is required to add the user id as a user property in order to query it as a dimension? i have it set up in GTM without the user property (just the fields to set) and i created the dimension in the GA4 UI and it works properly.
@@AnalyticsMania no, it is configured a user scope dimension in the GA4 UI. *in the web GTM it is in the fields to set, but all the requests are sent to SGTM and passed to GA4 (without any modifications in the SGTM UI)
Absolustely amazing. Cant praise enough for content. Kudos. Just one thing. You are going too fast. Just slow down . I had to slow down youtube in order to follow. But great contents never the less.
Very useful video. I have a question about how to handle the userId in case the user is already logged in the website. In your examples the login action always sets the userId, but if user visits the site later and he is already logged in, how do you push the userid to the data layer for each page view and/or action
@@AnalyticsMania Another question! 02:41 - How can we push the user ID to the data layer? My client is quite messy, with no access to the backend or any developer whatsoever.
I'd advice against writing User ID into a Custom Dimension if you have more than 500 Users logging in a day since this would cause cardinality issues, i.e. form the 501st logged in visitor on GA4 would only record (other)
Could you please update this video now that GTM has changed the tag set (Missing GA4 configuration tag) etc. Not sure where to put user_id now so that it propagates across all events.
How do you handle the additional user property ('user_id_dimension') after the user logs out? It's persistent isn't it? So how do you set it to be no value when a user logs out? Sending undefined doesn't get sent over to GA servers, and sending a string that's empty could wrongly bind many users/sessions incorrectly together? Is it even an issue?
@@AnalyticsMania Then how to get user_id as a dimension in custom reports? I tried removing it , but I need to create custom reports with that. Specifically free-form reports, not User Explorer. Can you please help?
Напишу на русском =) Отличное видео, все понятно, все четко, по делу, максимум полезной информации при минимуме времени. A lot of thanks for this video! It shows deep knowledge of the author of how it works, it is quite short, but very helpful. Best wishies!
Thank you for the video. I've followed this set up but am having an issue where the container loaded event fires BEFORE the login (referring to 7:05 in video) which isn't allowing Analytics to see it. Any ideas?
@@AlecKirby Hi, our tean still cant do it. But I put it before the window loaded and still works. But the problem is I can not see the user_id in the comparison. The "Sign in with user ID" is still disabled. Do you know why?
@@thanhatlam5806 Sorry, without seeing what your referring to, I couldn't tell you. I know we've been having issues with data thresholding but that doesn't sound like what your experiencing. Hopefully you can find a resource online! This is definitely not easy and GA4 doesn't make it any easier.
@@AnalyticsMania Just to follow up here. I am tracking a lot of 'Button click events' with my GTM. Do I have to send the userId along as a Userproperty in all the Tags? Or is it okay that the userId is only sent in the GA4 configuration as the 'Fields to be set'? I'm not quite sure since you say 'Set them on all events' in the end.
Hello Julius I have observed that no GTM/GA influencers are showing the logout event and how to get rid of the userid variable when a user logouts. Any idea how I can go about that please?
@@AnalyticsMania Are you sure this workd? I tried using this but it seems like the user id is now there no matter if the user logs out. Even if I dont send the user_id again it still recognizes it. Could it be the GA cookie that was set now links the user to that cookie so no matter if you set the user_id to undefined it wont change anything?
@@tilarsmith3857 Late to the party, but I believe it's because you haven't set up a tag with a custom trigger that matches your pushed event name in the data layer. If you do this, it will trigger and send the login info to GA4 at the moment it's being pushed in the data layer. The user ID must be pushed at the moment of the login, and then on every page. As the user will navigate elsewhere on the site, they will remain logged in and the config tag will send the user ID on every page load.
@@JosianneLThessereault yes the custom trigger stuff works. but the login event still loads after the container loaded event, which causes the container loaded event not to have the userId value. Help please
Hi, Kristina! The reason why initially it's called as event parameter was because he was talking about a single thing. When comes to User Property, user_id is part of User Properties where you can find other parameter, if they are related to the user. :) I hope that helps.
Hi Julius I pushed the user id data layer to GTM, but my user ids aren't reflecting in Google Analytics 4 when I log in. I can still see the user id variable in the data layer id and did the same setup which you showed in the video. It's still not working for me. What could be the reason here? Your response would really help me.
@@RugvedaSherkar Could you elaborate on that please? Config tag (Google tag now) should be triggered either by All pages or Initialization - All pages, shouldn't it?
hello! thanks so much for your video. what might be happening when my user_id (the one passed through datalayer) is coming null in a specific app version? my second question is, i also created a parameter for user id in the login event. first it was read as a string, and all of a sudden it is double value, what might be happening? thank you so much for your time and attention
Hi Julius !
How do I add user_id to basic events such as page_view, scroll, etc. provided by "GA4"?
This has been helpful in so many ways. Definitely covers a lot more than all the other resources on the web, and that too in a very short tutorial. Thank you so much!
Hi Julius! Thank you for the video. I have kinda stupid question but still 😅 What's use cases for user id if I don't use bigQuery? I'm mostly looking at GA4 to understand which traffic source bring more people and set up events to understand how people interact with website. How can I use user id in my favor only in GA4?
Hola Julius!! You don't idea how useful are your videos for me. Thank you!! I am straggling with the implementation of the user id, some things have changed both within GTM and GA4. For example we no longer have the User Properties in GTM so I don't know how to create the dimension. Do you know what can I do?
I heard about some disadvantages using the user ID. E.g. when a user locks out he is counted always with a new generated user ID. What is your view on that?
Thank you for great view. why I do not see any "User Properties" under my G4A Tag Config?
Hi Juluis, Will there be anything different when you are trying to do this on a Single page Web application aka PWA site. There is no container loaded on the logging in on the page.
It's the same way for SPA too. I have implemented this on SPA
Great video! I don't even need to watch another one on how to set it up. I just need to find one that goes into how we can use this in GA4 reporting.
In one of your videos, you suggested to keep this setting in GA4 config Tag "Send a page view event when this configuration loads" - OFF... But in this case of User ID tracking you are leaving this setting checked (I mean you are keeping it on). What should I do? Whether to leave it as it is or should I switch this off?
thanks. the userID has not been sent to previous sessions for the same user, is the only way to connect user to his actions before registered is to find the psuedoID and connect them in Bigquery?
Is this the same approach for SPA?
Hi Julius, with new Tag Configuration, where should we add the user_id? Should it be under Configuration Settings Variable --> Configuration Parameter? Or under Shared Event Variables? Thanks for your help.
According google's documentation, configuration. And then I would also set it as a user parameter in all event tags
that's a great piece of information. i have a question- if a ga4 property have 3 data stream 2 for apps and 1 for website. should i implement the tracking code three time for each of the data stream?
@AnalyticsMania, do you happen to have a new version of this video? The "Fields to set" is no longer there, instead it seems to require an event to send that data over.
Currently, the up-to-date version is available in this course www.analyticsmania.com/courses/google-analytics-4-course/
Thanks for your videos, they're always so informative and helpful. I'm trying to use user ID to track people who have signed up over the last year but not returned in the last 3 months. Do you know if this is possible? Thanks in advance.
Hi Julius thanks for the videos, hey I have an issue with my user id . it might contain zeros on the left like this 001234 and the zeros disappeared when inside of GA4 Custom dimension.
How can I fix this ? Cheers
Massively helpful! Any issue you are aware of if we are sending user_id on a GA4 Event tag instead of setting on initial Configuration tag? This is because we only have one initial Container Load to fire Config Tag, with the login event and GA4 pageview hits sent on subsequent History Changes. Perhaps duplicating our Config Tag to fire on Container Load and subsequent Login event would solve?
Hello! Currently they've changed the the GA4 Configuration and has different options than what was shown in the video. Will there be an update video about this or can you recommend an article/tutorial which has the latest changes ?
Always check links in description www.analyticsmania.com/post/google-analytics-4-user-id/
Hello Julius, Could we track the page URL with the view item event of every user id?
Julius, as you know the User Properties drop down for the GA4 configuration has completely changed with Google Tag. Can you please re-do this video now that these instructions don't match?
Maybe in the future
Yes please. No idea how to do it with the new google tag
@@AnalyticsMania yes please makes the tutorial
I want to know:How can i see the difference of the new user in every step in funnel exploration?Can you hep me?
Great video ! Thank you.
I'm having an issue where all non-logged in users are getting counted as a single user with the user_id of "undefined", and my reports are off. Yet, what I read online says that it *should* be undefined. Any suggestions here would be appreciated!
Sounds like you are sending the word (string) "undefined" instead of real undefined value
in my case, container loaded events runs before my login event, and as such, I am unable to see the userid in my Google analytics. Is there a reason for this and a fix hopefully?
The fix for this was, I made sure I pushed my event before the Google tag container was declared. In essence, I wrote the code for the data layer event at the top of index.html file. Stored my user ID in local storage, that way I could retrieve it anywhere in the app.
Hi Julius,
Can this approach work if we have over 10000 users visiting our site daily?
Thanks Julius ;-)
What's the best to track "login" : this one or the training one? Is there any difference of performance?
The Methodology is huge because we use in one method "event" and but not in this method.
What do you mean "the training one"? The main point is to send user id with every event to GA4, regardless of how you get that id. Asking a developer to push the id is a robust option.
@@AnalyticsMania I mean the training : www.analyticsmania.com/courses/google-tag-manager-course-for-beginners/
Sorry, if I maybe did not understand the difference between the 2 methodologies
In my beginner course, I don't specifically explain user ID tracking. I just show one example of tracking a login event (but that is just to show the example of reading from the data layer, not the User ID tracking). The real method is in this youtube video (and also in the intermediate/advanced GTM course)
@@AnalyticsMania Thanks Julius, I understand 😃
How can I set up tracking and differentiate downloaded PDFs for logged in visitor vs not logged in visitor? PS. love your content
Do we have to create multiple tags for multiple users logged in???
no
For me Container Loaded event occurs before Login. How do I make sure it happens after login event fires ?
i dont think it is possible. because first javascript will load and then it will send status to gtm
Hi Julius! I want to track website visitors to app download. Is that possible with device ID only in GA4?
Hi,
i have Question like in my web application. I am using SSO for login but with different domain it will create different user in analytics.
also i am using same page for login in mobile application.
how can i overcome that issue.
any suggestion or solution you have please answer.
Yes your videos are very helpful to get through GA.
Thanks.
How to handle when the Cookie is set on "Secure" and GTM gives me undefined?
How to See other Fields with respect to user_id? For example, If I have custom dimenson like user_role , how can I map that data with the user_id? I want to visualize some other dimensions with user_id .
Hello dear, can i export all website visitor user id and import into Google ads customer list so i can retarget them 😀😀
Hi Julius, thx for your videos. One question about userId tracking, why in my GTM at I see a null value [{name: "user_id", value: undefined}]? I have logged in and user id shows fine on dataLayer, also I have defined the custom dlv in GTM. Thanks in advance.
Maybe the tag fires when dlv is still not available and data is not pushed yet
@@AnalyticsMania i have the same issue
@@stanislavlyu1827 same issue. were you able to find a fix?
Hi must we add the data layer on all pages of website or on the login page alone
All pages
@@AnalyticsMania Thank you will add the data layer event login along with user id push script for all pages
You are the best Julius!
Thank you for detailed, step-by-step instruction. This was super helpful.
Hi, I've implemented user_id through GTM, and I can see that event tags and Google Tags pull user ID from the data layer, but I can't see user_id in GA4 Debug View. Any ideas for the reason? Thanks!
Difficult to say without troubleshooting the setup
@@AnalyticsMania hi again! I think the issue is with the order in which my tags fire. I'm dealing with a SPA, and my Google Tag (set to Initialization - All pages) fires only once once the website loads. Once the signup or login event occurs, the page doesn't reaload, hence Google Tag doesn't fire. How can I make signup or login events (where I get my user ID) fire first? Thanks!
@@dimanikitin8278 I have the same issue, it doesn't appear in debugview, I tried everything, sequencing and ..., everything is fine in Tag manager preview, variables and event parameters are ok but in the debugview of GA4 there isn't any sign of user id
How can i enable user id on google analytics for google site?
Great video Julius! are you 100% sure it is required to add the user id as a user property in order to query it as a dimension?
i have it set up in GTM without the user property (just the fields to set) and i created the dimension in the GA4 UI and it works properly.
I tried it the way you describe and it did not work for me (if I set it as a user scoped custom dimension)
Maybe you created an event scoped dimension?
@@AnalyticsMania no, it is configured a user scope dimension in the GA4 UI.
*in the web GTM it is in the fields to set, but all the requests are sent to SGTM and passed to GA4 (without any modifications in the SGTM UI)
I tried various configurations but the one that worked well for me was with user properties.
Absolustely amazing. Cant praise enough for content. Kudos. Just one thing. You are going too fast. Just slow down . I had to slow down youtube in order to follow. But great contents never the less.
Very useful video. I have a question about how to handle the userId in case the user is already logged in the website. In your examples the login action always sets the userId, but if user visits the site later and he is already logged in, how do you push the userid to the data layer for each page view and/or action
You push it same way. Just do it before GTM container loads.
@@AnalyticsMania May I know how to do it before GTM container loads? Something related to web coding? Have any example on it?
Thanks.
@@holaiyee1039 I have the same questionс
@@AnalyticsMania I have the same question
Same question..
What about if there is no login option? Would this user ID tracking be useful anyway?
No
Ok thank you!
@@AnalyticsMania Another question! 02:41 - How can we push the user ID to the data layer? My client is quite messy, with no access to the backend or any developer whatsoever.
I'd advice against writing User ID into a Custom Dimension if you have more than 500 Users logging in a day since this would cause cardinality issues, i.e. form the 501st logged in visitor on GA4 would only record (other)
But how to track more than 500 userid in one time with in user explorer report
Could you please update this video now that GTM has changed the tag set (Missing GA4 configuration tag) etc. Not sure where to put user_id now so that it propagates across all events.
The blog post in the description has updated instructions
please make a video to get client_id to Google analytics 4.
How do you handle the additional user property ('user_id_dimension') after the user logs out?
It's persistent isn't it? So how do you set it to be no value when a user logs out? Sending undefined doesn't get sent over to GA servers, and sending a string that's empty could wrongly bind many users/sessions incorrectly together? Is it even an issue?
It is no longer recommended to send user id dimension/property
@@AnalyticsMania Then how to get user_id as a dimension in custom reports? I tried removing it , but I need to create custom reports with that. Specifically free-form reports, not User Explorer. Can you please help?
very helpful.
Напишу на русском =) Отличное видео, все понятно, все четко, по делу, максимум полезной информации при минимуме времени.
A lot of thanks for this video! It shows deep knowledge of the author of how it works, it is quite short, but very helpful. Best wishies!
Thank you for the video. I've followed this set up but am having an issue where the container loaded event fires BEFORE the login (referring to 7:05 in video) which isn't allowing Analytics to see it. Any ideas?
same problem to me. Did you figure it out?
@@thanhatlam5806 I did yes, our development team had to prioritize the firing order. It isn't something you can do in GTM unfortunately.
@@AlecKirby Hi, our tean still cant do it. But I put it before the window loaded and still works. But the problem is I can not see the user_id in the comparison. The "Sign in with user ID" is still disabled. Do you know why?
@@thanhatlam5806 Sorry, without seeing what your referring to, I couldn't tell you. I know we've been having issues with data thresholding but that doesn't sound like what your experiencing. Hopefully you can find a resource online! This is definitely not easy and GA4 doesn't make it any easier.
But where is the login event launched?
Do I need to push user ID in every pageview?
you need to send user id with every pageview and event. Thus you will most likely to push it on every pageview.
@@AnalyticsMania But if you send further on the first view of the page, it will be lost?
@@AnalyticsMania Just to follow up here. I am tracking a lot of 'Button click events' with my GTM. Do I have to send the userId along as a Userproperty in all the Tags? Or is it okay that the userId is only sent in the GA4 configuration as the 'Fields to be set'? I'm not quite sure since you say 'Set them on all events' in the end.
Hello Julius
I have observed that no GTM/GA influencers are showing the logout event and how to get rid of the userid variable when a user logouts. Any idea how I can go about that please?
Just ask a developer to push user_id as undefined to the data layer. If it's a new page, just ask your dev to not push the user id at all.
@@AnalyticsMania Are you sure this workd? I tried using this but it seems like the user id is now there no matter if the user logs out. Even if I dont send the user_id again it still recognizes it. Could it be the GA cookie that was set now links the user to that cookie so no matter if you set the user_id to undefined it wont change anything?
Not working. No tag is firing on "login" event. Moreover, login event fires after Container loaded and the config tag has no info about user anything.
Dude I’m having the same issue. Did you manage to solve it?
@@tilarsmith3857 Late to the party, but I believe it's because you haven't set up a tag with a custom trigger that matches your pushed event name in the data layer. If you do this, it will trigger and send the login info to GA4 at the moment it's being pushed in the data layer. The user ID must be pushed at the moment of the login, and then on every page. As the user will navigate elsewhere on the site, they will remain logged in and the config tag will send the user ID on every page load.
@@JosianneLThessereault yes the custom trigger stuff works. but the login event still loads after the container loaded event, which causes the container loaded event not to have the userId value. Help please
sameee issue, any luck?
Ty for video...GA4 just 1 big disappointment. Weak combination of UA+datastudio but can't
Great video, thanks so much.
I'm curious why user_id was set initially as an event parameter but when you look in the debug mode, it shows up as User Property.
Hi, Kristina! The reason why initially it's called as event parameter was because he was talking about a single thing. When comes to User Property, user_id is part of User Properties where you can find other parameter, if they are related to the user. :) I hope that helps.
user_id is a special parameter. Even though it is sent as a parameter, it is displayed as a user property in the debugview
Hi great video! Question: On fields to set (6:14) you sure it's user_id not userId? :)
Yes, user_id.
It's GA4, not GA3
@@AnalyticsMania Thanks! Really appreciate the response :)
What about clients who do not have or require login on their website.
Then this feature is not for them
Hi Julius
I pushed the user id data layer to GTM, but my user ids aren't reflecting in Google Analytics 4 when I log in.
I can still see the user id variable in the data layer id and did the same setup which you showed in the video. It's still not working for me.
What could be the reason here?
Your response would really help me.
Hi, Even I am facing the same problem. Did you resolve this?
Facing same problem
Try creating a custom login trigger for the config tag where you are passing user_id. It worked for me
@@RugvedaSherkar Could you elaborate on that please? Config tag (Google tag now) should be triggered either by All pages or Initialization - All pages, shouldn't it?
@@dimanikitin8278 No need to create custom login for config. Just pass it through config tag in configuration parameters and in user property.
Is there any GA4 demo account like Google Analytics? If yes can you share with me the link for practicing purpose
th-cam.com/video/9WA7vXuP0W4/w-d-xo.html
Hi!
very good video. I would be interested to know if I can consult you some things that I have doubts
Yes, analyticsmania.com/call
How about Google ads Transaction ID please make a video.
hello! thanks so much for your video. what might be happening when my user_id (the one passed through datalayer) is coming null in a specific app version?
my second question is, i also created a parameter for user id in the login event. first it was read as a string, and all of a sudden it is double value, what might be happening?
thank you so much for your time and attention
very informative, thank a lot
Anyone know why my 'Signed in with User id' can not selectable ? I can see user_id in Debug view
hic same to me. Did you find out the way to show it? Thanks!
Thanks!
Ďakujeme.
Massive!!
Ккке
That isn't what I need.