User ID tracking with Google Analytics 4 and Google Tag Manager
Ғылым және технология
Learn how to implement Google Analytics 4 user ID tracking with Google Tag Manager. In this video, I will explain:
* How to send user id to Google Analytics 4
* How to check if user ID is properly received by Google Analytics 4
* How to see user ID as a dimension in Google Analytics 4
This tutorial assumes that you already know the basics of Google Tag Manager. If not, then watch this tutorial first: • Google Tag Manager Tut...
=== LINKS ===
Subscribe to our KZread channel / @analyticsmania
✭ Google Tag Manager tutorial for Beginners
• Google Tag Manager Tut...
✭ Google Tag Manager plugin for Wordpress
gtm4wp.com/
📕 Free e-book: Google Tag Manager for Beginners
www.analyticsmania.com/free-e...
📕 Free e-book: Getting Started with Google Analytics 4
www.analyticsmania.com/p/gett...
⭐⭐ Google Analytics 4 course ⭐⭐
www.analyticsmania.com/course...
=== CONNECT WITH JULIUS & ANALYTICS MANIA ===
✭ Facebook / analyticsmania
✭ Twitter / fedorovicius
✭ Linkedin / fedorovicius
Subscribe to our KZread channel / @analyticsmania
#googletagmanager
Пікірлер: 135
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!
Thank you for detailed, step-by-step instruction. This was super helpful.
You are the best Julius!
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.
Great video, thanks so much.
very informative, thank a lot
very helpful.
Thanks!
Hi Julius ! How do I add user_id to basic events such as page_view, scroll, etc. provided by "GA4"?
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?
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?
Ďakujeme.
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?
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?
Напишу на русском =) Отличное видео, все понятно, все четко, по делу, максимум полезной информации при минимуме времени. 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!
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.
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?
How can I set up tracking and differentiate downloaded PDFs for logged in visitor vs not logged in visitor? PS. love your content
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?
Thank you for great view. why I do not see any "User Properties" under my G4A Tag Config?
Hello Julius, Could we track the page URL with the view item event of every user id?
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.
For me Container Loaded event occurs before Login. How do I make sure it happens after login event fires ?
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 .
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.
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
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
2 жыл бұрын
I tried it the way you describe and it did not work for me (if I set it as a user scoped custom dimension)
@AnalyticsMania
2 жыл бұрын
Maybe you created an event scoped dimension?
@OronM
2 жыл бұрын
@@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)
@AnalyticsMania
2 жыл бұрын
I tried various configurations but the one that worked well for me was with user properties.
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!
@AnalyticsMania
9 ай бұрын
Sounds like you are sending the word (string) "undefined" instead of real undefined value
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?
@AnalyticsMania
9 ай бұрын
Maybe in the future
@ivanflores1719
9 ай бұрын
Yes please. No idea how to do it with the new google tag
@AhmadYazid21
9 ай бұрын
@@AnalyticsMania yes please makes the tutorial
please make a video to get client_id to Google analytics 4.
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.
@AnalyticsMania
8 ай бұрын
According google's documentation, configuration. And then I would also set it as a user parameter in all event tags
Hi Julius! I want to track website visitors to app download. Is that possible with device ID only in GA4?
Is this the same approach for SPA?
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.
@AnalyticsMania
2 жыл бұрын
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.
@1973youness
2 жыл бұрын
@@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
@AnalyticsMania
2 жыл бұрын
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)
@1973youness
2 жыл бұрын
@@AnalyticsMania Thanks Julius, I understand 😃
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)
@sonambhargava2033
10 ай бұрын
But how to track more than 500 userid in one time with in user explorer report
How can i enable user id on google analytics for google site?
I want to know:How can i see the difference of the new user in every step in funnel exploration?Can you hep me?
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 ?
@AnalyticsMania
2 ай бұрын
Always check links in description www.analyticsmania.com/post/google-analytics-4-user-id/
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.
@user-zw3zn2lk6q
9 ай бұрын
It's the same way for SPA too. I have implemented this on SPA
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
2 жыл бұрын
You push it same way. Just do it before GTM container loads.
@holaiyee1039
2 жыл бұрын
@@AnalyticsMania May I know how to do it before GTM container loads? Something related to web coding? Have any example on it? Thanks.
@armenadamyan5890
2 жыл бұрын
@@holaiyee1039 I have the same questionс
@armenadamyan5890
2 жыл бұрын
@@AnalyticsMania I have the same question
@MAIA3012
2 жыл бұрын
Same question..
Massive!!
Hi great video! Question: On fields to set (6:14) you sure it's user_id not userId? :)
@AnalyticsMania
2 жыл бұрын
Yes, user_id. It's GA4, not GA3
@smartlogxasia3432
2 жыл бұрын
@@AnalyticsMania Thanks! Really appreciate the response :)
How about Google ads Transaction ID please make a video.
Hi Julius, Can this approach work if we have over 10000 users visiting our site daily?
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?
@okorieemmanuella5057
Жыл бұрын
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.
Hello dear, can i export all website visitor user id and import into Google ads customer list so i can retarget them 😀😀
How to handle when the Cookie is set on "Secure" and GTM gives me undefined?
Do we have to create multiple tags for multiple users logged in???
@AnalyticsMania
9 ай бұрын
no
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?
@thanhatlam5806
Жыл бұрын
same problem to me. Did you figure it out?
@AlecKirby
Жыл бұрын
@@thanhatlam5806 I did yes, our development team had to prioritize the firing order. It isn't something you can do in GTM unfortunately.
@thanhatlam5806
Жыл бұрын
@@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?
@AlecKirby
Жыл бұрын
@@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.
Hi! very good video. I would be interested to know if I can consult you some things that I have doubts
@AnalyticsMania
2 жыл бұрын
Yes, analyticsmania.com/call
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.
@ricardocristofolini2624
2 жыл бұрын
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.
@AnalyticsMania
2 жыл бұрын
user_id is a special parameter. Even though it is sent as a parameter, it is displayed as a user property in the debugview
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
2 жыл бұрын
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.
@adrenaline681
Жыл бұрын
@@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?
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
Is there any GA4 demo account like Google Analytics? If yes can you share with me the link for practicing purpose
@AnalyticsMania
2 жыл бұрын
kzread.info/dash/bejne/a4t1mdiRpbOWh5c.html
Hi must we add the data layer on all pages of website or on the login page alone
@AnalyticsMania
Жыл бұрын
All pages
@SKYLANCHE
Жыл бұрын
@@AnalyticsMania Thank you will add the data layer event login along with user id push script for all pages
Ty for video...GA4 just 1 big disappointment. Weak combination of UA+datastudio but can't
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.
@AnalyticsMania
8 ай бұрын
The blog post in the description has updated instructions
What about clients who do not have or require login on their website.
@AnalyticsMania
Жыл бұрын
Then this feature is not for them
But where is the login event launched?
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
11 ай бұрын
It is no longer recommended to send user id dimension/property
@user-zw3zn2lk6q
4 ай бұрын
@@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?
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
4 ай бұрын
Difficult to say without troubleshooting the setup
@dimanikitin8278
3 ай бұрын
@@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!
@ahmadrezanajafipoor4415
Ай бұрын
@@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
Anyone know why my 'Signed in with User id' can not selectable ? I can see user_id in Debug view
@thanhatlam5806
Жыл бұрын
hic same to me. Did you find out the way to show it? Thanks!
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.
@tilarsmith3857
Жыл бұрын
Dude I’m having the same issue. Did you manage to solve it?
@JosianneLThessereault
Жыл бұрын
@@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.
@okorieemmanuella5057
Жыл бұрын
@@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
@sureshtr4277
9 ай бұрын
sameee issue, any luck?
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.
@rugvedasherkar9092
11 ай бұрын
Hi, Even I am facing the same problem. Did you resolve this?
@shriyamtyagi9203
11 ай бұрын
Facing same problem
@user-zw3zn2lk6q
9 ай бұрын
Try creating a custom login trigger for the config tag where you are passing user_id. It worked for me
@dimanikitin8278
3 ай бұрын
@@user-zw3zn2lk6q 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?
@user-zw3zn2lk6q
3 ай бұрын
@@dimanikitin8278 No need to create custom login for config. Just pass it through config tag in configuration parameters and in user property.
What about if there is no login option? Would this user ID tracking be useful anyway?
@AnalyticsMania
5 ай бұрын
No
@JuanIgnacioLX
5 ай бұрын
Ok thank you!
@JuanIgnacioLX
5 ай бұрын
@@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.
Do I need to push user ID in every pageview?
@AnalyticsMania
2 жыл бұрын
you need to send user id with every pageview and event. Thus you will most likely to push it on every pageview.
@armenadamyan5890
2 жыл бұрын
@@AnalyticsMania But if you send further on the first view of the page, it will be lost?
@jizzwow
2 жыл бұрын
@@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.
Ккке
That isn't what I need.
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.
@AnalyticsMania
2 жыл бұрын
Maybe the tag fires when dlv is still not available and data is not pushed yet
@stanislavlyu1827
Жыл бұрын
@@AnalyticsMania i have the same issue
@okorieemmanuella5057
Жыл бұрын
@@stanislavlyu1827 same issue. were you able to find a fix?