Analytics
4.3K members online now
4.3K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

User or Hit Level Scope for User ID?

Follower ✭ ✭ ☆
# 1
Follower ✭ ✭ ☆

While working on Custom Dimensions in GA for setting up User ID, which scope should i use?

User or Hit level? Few sources in web say hit and a few say user. 

Please suggest which one is perfect and accurate to track the User IDs. 

 

Refer the screenshots here: After I have made these settings, I am able to track only one User ID in GA, but the rest of the User IDs are not being tracked by GA. Did i go wrong anywhere? Please suggest. 

 

DLV - userID.jpgData Layer Variable

 ----------------------------  ----------------------------  ----------------------------  ----------------------------  ----------------------------

 

GA - Custom Dimension.jpgCustom Dimension in GA

  ----------------------------  ----------------------------  ----------------------------  ----------------------------  ----------------------------

 

GA Tag .jpgTag Configured

 

 Would appreciate if someone can assist me with a solution to track all the User IDs accurately. 

 

 

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Shashank S
May 2017

User or Hit Level Scope for User ID?

[ Edited ]
Participant ✭ ✭ ✭
# 6
Participant ✭ ✭ ✭

@Bronwyn V gave you a really good answer. High-five!

 

@shashank s just keep in mind:

1) Hit – value is applied to the single hit for which it has been set. You should use this scope if you want to track something that changes in between interactions.
2) Session – value is applied to all hits in a single session.
3) User – value is applied to all hits in current and future sessions until value changes or custom dimension is made inactive.

Here you can read more about different scopes.

I recommend tracking User ID in two separate custom dimensions. 

1) Hit Scoped
2) User Scoped

The User Scoped dimension is pretty obvious - once you have assigned an ID to the specific user, this will be applied to all the hits in current and future sessions.

But you have to keep in mind that if you use a session or user scope dimension, only the last value is actually recorded in one session. So if there can be a situation when one person will login twice (he/she has 2 different accounts = 2 User-IDs) during one session, you'll lose the information about the first User-ID because it will be overwritten by the second one.

That's the reason why I prefer tracking User ID in two separate custom dimensions. You'll get even more granular data. Smiley Happy


Make sure that you're using the right variable in GTM. Use the preview mode in order to debug your User ID configuration. Login with different accounts and make sure that this User ID value changes. If it doesn't change, there's probably something wrong on the dataLayer (you'll need to get in touch with your developer).

Hope this helps.
Taavi

View solution in original post

User or Hit Level Scope for User ID?

Top Contributor
# 2
Top Contributor

Hi :-)

UserID needs need to be a unique ID generated for each user and assigned consistently to each user via your own system, this information then needs to get passed to google analytics.

https://support.google.com/analytics/answer/3123666?hl=en&ref_topic=3123660#SetUpUserID

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

User or Hit Level Scope for User ID?

Follower ✭ ✭ ☆
# 3
Follower ✭ ✭ ☆

Hi @Bronwyn V,

 

Do you mean - the scope should be set to "User" in the Custom Dimension section of GA?

Yes or NoSmiley Happy

 

Hope you've checked out the above screenshots. I am able to track User ID only if i hard code but through dataLayer, the values are not getting pushed to GA. As a result, I am not able to see any data in User ID view though I've tested logging-in several times with multiple User IDs.

User or Hit Level Scope for User ID?

Top Contributor
# 4
Top Contributor

You can set it to any scope you want.. I would set it to User.

So Yes

 

For help with GTM related questions and configuration etc, you should also ask on the GTM Help Forum

https://productforums.google.com/forum/#!forum/tag-manager

 

You mention that a userID hardcoded into the dataLayer works.
how is your system creating and assigning the userID to the applicable site visitor.. to then pass that info to GTM to populate the variable?

(beyond my skill set however hopefully someone else here or on the GTM help forum will be able to assist you)

 

 

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

User or Hit Level Scope for User ID?

Follower ✭ ✭ ☆
# 5
Follower ✭ ✭ ☆

Sorry for the confusion. The hard-coded value was just for testing and it doesn't exist anymore. 

 

The latest report that I have noticed in User ID view is: I am able to track User IDs but the time it is taking a lot of time to reflect in the GA reports. Is there any specific time that User ID view takes to collect, pass and display the data in the reports? Sorry, I might sound little insane but it is out of curiosity. 

 

GTM - Yes, I have requested over there as well, unfortunately no response yet. 

I have raised my concern about GTM in this forum since it is linked with GA. 

Please let me know if you just review my GTM settings, they are just Event & Tag configurations. If you are ok, I shall share the screenshots. 

 

Nothing is beyond skillset being one of the top contributors Smiley Happy 

Indeed, thanks a lot for your response. 

Marked as Best Answer.
Solution
Accepted by topic author Shashank S
May 2017

User or Hit Level Scope for User ID?

[ Edited ]
Participant ✭ ✭ ✭
# 6
Participant ✭ ✭ ✭

@Bronwyn V gave you a really good answer. High-five!

 

@shashank s just keep in mind:

1) Hit – value is applied to the single hit for which it has been set. You should use this scope if you want to track something that changes in between interactions.
2) Session – value is applied to all hits in a single session.
3) User – value is applied to all hits in current and future sessions until value changes or custom dimension is made inactive.

Here you can read more about different scopes.

I recommend tracking User ID in two separate custom dimensions. 

1) Hit Scoped
2) User Scoped

The User Scoped dimension is pretty obvious - once you have assigned an ID to the specific user, this will be applied to all the hits in current and future sessions.

But you have to keep in mind that if you use a session or user scope dimension, only the last value is actually recorded in one session. So if there can be a situation when one person will login twice (he/she has 2 different accounts = 2 User-IDs) during one session, you'll lose the information about the first User-ID because it will be overwritten by the second one.

That's the reason why I prefer tracking User ID in two separate custom dimensions. You'll get even more granular data. Smiley Happy


Make sure that you're using the right variable in GTM. Use the preview mode in order to debug your User ID configuration. Login with different accounts and make sure that this User ID value changes. If it doesn't change, there's probably something wrong on the dataLayer (you'll need to get in touch with your developer).

Hope this helps.
Taavi

Re: User or Hit Level Scope for User ID?

Follower ✭ ✭ ☆
# 7
Follower ✭ ✭ ☆

@Taavi Kalvi: Thanks for such a detailed explanation. 

As far as I know, I have used the right variable in GTM, I've shared the screenshots earlier in this post.

According to your suggestion, I should be using two Custom Dimensions as shown below:  

Custom Dimensions.jpg

Index 1: User Scope

Index 2: Hit Scope

 

Is this perfect way to go ahead now? 

 

 

Re: User or Hit Level Scope for User ID?

[ Edited ]
Participant ✭ ✭ ✭
# 8
Participant ✭ ✭ ✭

@shashank s it's just my way how to user User-ID tracking.

How does the userID value look like on your dataLayer?

There are a couple of ways to figure this out but the easiest way is to find it if you open your GTM preview mode:

uid_1.png

uid2.png

Do you see something similar?

@Bronwyn V  feel free to share your thoughts as well. Smiley Happy

Cheers,
Taavi

User or Hit Level Scope for User ID?

Follower ✭ ✭ ☆
# 9
Follower ✭ ✭ ☆

Yes, @Taavi Kalvi

I did see the same thing and things are fine now. 

I have used "User" scope alone though. 

Thank you and @Bronwyn V for your insights and timely help. 

 

Re: User or Hit Level Scope for User ID?

Follower ✭ ✭ ☆
# 10
Follower ✭ ✭ ☆

@Taavi Kalvi: Great answer on using two scopes for User ID custom dimensions.

 

I just ran into a similar situation, where I'm only sending the User ID as a User-scoped custom dimension and have a few users that log in with different accounts using the same device. Here is what I noticed happens:

 

  • In the User ID-enabled View, an advanced segment specifying a unique value for the User ID custom dimension returns only the activity for when the user was actually browsing with said User ID.
  • In non-User ID views, the same advanced segment returns multiple users (i.e. clients) but all hits are attributed to the last logged in User ID.

 

So it looks like User ID-enabled views treat User-scoped custom dimensions quite differently from regular Views: they scope user dimensions to the set User ID (via userId field) vs the Client ID.

 

Is my understanding correct?

 

Thanks!