Analytics
6.3K members online now
6.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

Data won't appear in my User ID enabled view

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I set up a User ID view in my Google Analytics Account and configured Google Tag Manager to set the userId field by retrieving the value for that field from user_id Data Layer variable.

Screen Shot 2017-02-16 at 15.07.22.png

When I check the values for both the user_id Data Layer variable and the userId field in my GTM debug console, I can see they are both OK and have values. But still I can see no data in my reports. Do you have any ideas why?

Screen Shot 2017-02-16 at 15.08.51.pngScreen Shot 2017-02-16 at 15.09.03.png

Thank you 

1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Artem D
February 2017

Data won't appear in my User ID enabled view

Follower ✭ ☆ ☆
# 6
Follower ✭ ☆ ☆

1) Is the dataLayer.push() with the userId before the GTM container snippet in the page template?

2) Are you using the All Pages trigger?

 

If (1) is not true and (2) is true, then GTM tags fire before userId is set in dataLayer.

View solution in original post

Data won't appear in my User ID enabled view

Explorer ✭ ✭ ✭
# 2
Explorer ✭ ✭ ✭

Did you enable user ID in the Property Setting? Sorry for somewhat stupid suggestion

Re: Data won't appear in my User ID enabled view

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Yes, it's enabled.

Screen Shot 2017-02-16 at 15.30.35.png

 

Data won't appear in my User ID enabled view

Participant ✭ ✭ ✭
# 4
Participant ✭ ✭ ✭

Hi Artem,

I face same situation a week ago. are you seeing data in real time?? Can you share data layer code??

 

I have changed data layer code and starts working. I've defined data layer like

 

<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event' : 'userIdSet',
'userId' : '5'
});
</script>  and placed just above Google tag manager snippet.

 

Thanks 

Data won't appear in my User ID enabled view

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Hi, Santosh!

Thanks a lot for your answer.

The code from your comment does the following. First it creates a GTM custom event called userIdSet, then it creates a Data Layer variable userId and assigns the value 5 to it.

 

The code won't help me unless I configure my tags (or GA views or both) the way you did.

 

So there should be a tag in your GTM configured to fire when the 'userIdSet' event occurs. Could you show me the configuration of that tag please?

Marked as Best Answer.
Solution
Accepted by topic author Artem D
February 2017

Data won't appear in my User ID enabled view

Follower ✭ ☆ ☆
# 6
Follower ✭ ☆ ☆

1) Is the dataLayer.push() with the userId before the GTM container snippet in the page template?

2) Are you using the All Pages trigger?

 

If (1) is not true and (2) is true, then GTM tags fire before userId is set in dataLayer.

Data won't appear in my User ID enabled view

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Simo, thank you very much for the answer.

I'm checking if the first of the conditions is true. But the tag fires on all pages, that's true. Because it's a standard Universal Analytics Tracking tag.

 

What is confusing me is that I can see the contents of the Google Analytics tag in my GTM debug console and the field Fields to set contains a correct value. Take a look at the screenshot in my first post please. So if the push of the userId to dataLayer happens after the GTM container snippet fires, how is it possible that the 'Fields to set' field still gets its value?

Data won't appear in my User ID enabled view

Follower ✭ ☆ ☆
# 8
Follower ✭ ☆ ☆

It depends what event you have selected in Preview mode. If you have "Summary" selected, or "Window Loaded", for example, GTM will show you values in the tag that correspond to what they are at the time of the event. So at "Summary" GTM will show what the latest value for each variable in the tag is.

That's why you should only Preview tag fields for the event that fired the tag. For the "All Pages" trigger, the event is "Page View". In other words, if you select the "Page View" event, then open your tag settings, GTM will show you what values the tag had when it actually fired.

 

And even then there might be inconsistencies.

 

The only way to be absolutely sure that your requests are completing with the correct values is to look at the actual network requests fired on the site to /collect (GA's endpoint), and checking if they have all the correct parameters (e.g. &uid for User ID).

Data won't appear in my User ID enabled view

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭

Simo, now everything is clear to me. Thank you very much for your help. Indeed the problem was that the userId value was pushed to the dataLayer after the GTM-container code.