Problem Getting UserID into GA
I have a website with user sign-in and I'm trying to send the User ID data into GA but not being successful.
I have set up GTM as shown
And user ID tracking is enabled in GA
Our user ID is coming through in the datalayer as seen below
But nothing appear to be being sent through to GA (and the reports in the new view I have set up are empty. ). Any ideas/suggestions?
Could it be a timing issue if the userId variable is not defined at the time that the tag fires?
Re: Problem Getting UserID into GA
Here is a great guide from Simo Ahava about using dataLayer in GTM particularly for userID functionality: http://www.simoahava.com/analytics/data-layer/
Particulary this code from above article you may find useful:
window.dataLayer = window.dataLayer || ;
'userId' : 'abf5-3245-ffd1-23ed'
<!-- GTM Container Snippet Code Here -->
Also if above is not the case a few follow-up questions/suggestions:
1. Did you enable custom dimension in GA that is specified in UA firing tag? Is it hit level? Is it at the same index number as you have it in tag?
2. Do you check your data in User-ID view or regular view? Is User ID view enabled? Does your custom dimension show any data when applied to any standard report in your regular view?
3. Google strictly recommends that field containg userID should be named "&uid" in Fields to set part of UA Tags in GTM. Did you try doing that? Source: https://support.google.com/tagmanager/answer/4565987