AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
1.6K members online now
1.6K 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

Analytics UserID tracking not complete?

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi guys,

 

I am having problems with the userID tracking in Analytics and with the code. I have installed the following code (see attachments) where the user id number '2' is specified per user (each user gets it's own Magento client ID which gets inserted here). Please understand that this webshop is behind a login, so every visitor first needs to log in to the webshop before they can even navigate the shop.

 

In GA I can finally see the different users, but I have a problem I just can't figure out: all users are unassigned in the coverage User ID (100% unassigned)! Because everybody needs to log in, this percentage should be a lot lower, right?

 

Thanks in advance!

 

Tommy

 

code.jpg

 

1 Expert replyverified_user

Re: Analytics UserID tracking not complete?

Top Contributor
# 2
Top Contributor
Hi Tommy,

Did you enable the User-ID feature in Admin -> Property -> Tracking Info -> User-ID? You need to Create a User-ID view there also.

For modifying your tracking code in order to send the User-ID to Google Analytics please check this document:
https://developers.google.com/analytics/devguides/collection/analyticsjs/cookies-user-id#user_id

You can read more about the User-ID feature here:
https://support.google.com/analytics/topic/6009743?hl=en&ref_topic=1007027

Hope this helps.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Analytics UserID tracking not complete?

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi Arnold,

Thanks for your reply. I did indeed turn on the User ID feature in the admin and I am getting the right ID's in GA, but in the coverage report they keep showing up as unassigned. That's the weird part; all are unassigned, but in the pages-report I can see the user IDs (which indicated that they are assigned)

Thanks

Re: Analytics UserID tracking not complete?

Top Contributor
# 4
Top Contributor

Hi,

 

Instead of:

ga('set', 'dimension1', '2');

Set the user ID as:

ga('create', 'UA-XXXXX-Y', { 'userId': 2 });

Let me know how you get on.


Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Analytics UserID tracking not complete?

A T
Participant ✭ ✭ ✭
# 5
A T
Participant ✭ ✭ ✭
userId : is the internal variable GA uses for user id feature.

You can also set it to some custom dimension for reporting on it.

Re: Analytics UserID tracking not complete?

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

Ok, I will try that immediately! As far as I understood there is no need to change the dimension in GA, right? It is now set up like in the screenshot. It is supposed to be set to HIT instead of user as I understood from other websites.userID.png

Re: Analytics UserID tracking not complete?

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Hi guys,

 

I have to bother you one more time.. It seems that the assigned/unassigned issue is now resolved (thanks!) but I still have this weird issue. Like I said everybody needs to log in when they enter the webshop, but I still only get ~ 3% pageviews when selecting the userID as second dimension. The top part is the 100% view, below is when selecting userID as second dimension:

 

weird.png

Re: Analytics UserID tracking not complete?

A T
Participant ✭ ✭ ✭
# 8
A T
Participant ✭ ✭ ✭
Hi,

It will only work on GA data moving forward.
Setting don't apply for historical data.

Best Regards,
GA Guru.

'Star' or 'Accept as Solution' if it helped.

Re: Analytics UserID tracking not complete?

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭
I know, that's why I have set the date to yesterday only. So the above screenshot is from one day. I checked it with this morning as well, and same issue. 1500 pageviews this morning, and no pageviews with userID.

Re: Analytics UserID tracking not complete?

[ Edited ]
Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭

Still not working properly unfortunately. I have the following code on every page:

//<![CDATA[
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', '***', { 'userId': 2 });
ga('send', 'pageview');
//]]>


And now I don't get any ID anymore. I really don't understand what is going on. Perhaps one of you guys know why I don't get any IDs?

Thanks