4.9K 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

GTM User ID

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭
 
Hi All!

So I am the non-developer working with our team on GTM... having trouble understanding data layer ins and outs enough to make sure i get the team the right info.

We've got the below pushing through - and i see it in the preview mode successfully... but I don't see anything in Analytics yet. First off, can anyone quickly help me if the snippet is wrong? Secondly, I set up the variable in GTM with user_id as it saw it there - sound right?

<script type="text/javascript">
// Here's where you define the data layer
dataLayer = [{
"user": {
"user_id": "58476"
},
"page": {
"type": "home"
}
}];
</script>

Thanks in advance! x
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Charlotte T
August 2016

Re: GTM User ID

Explorer ✭ ✭ ✭
# 2
Explorer ✭ ✭ ✭
Hi,

The snippet should be
&lt;script type="text/javascript">
// Here's where you define the data layer
window.dataLayer=window.dataLayer||[];
dataLayer.push({
"user_id": "58476",
"page_type": "home"
});
&lt;/script&gt;

There the variables in GTM that would be created are like these
For user_id
http://take.ms/srndI

For page_type
http://take.ms/D9OJ3

Join us on our google analytics community : https://plus.google.com/u/0/communities/100140026864685295841

Hope this helps,
Cheers
Noman karim

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Charlotte T
August 2016

Re: GTM User ID

Explorer ✭ ✭ ✭
# 2
Explorer ✭ ✭ ✭
Hi,

The snippet should be
&lt;script type="text/javascript">
// Here's where you define the data layer
window.dataLayer=window.dataLayer||[];
dataLayer.push({
"user_id": "58476",
"page_type": "home"
});
&lt;/script&gt;

There the variables in GTM that would be created are like these
For user_id
http://take.ms/srndI

For page_type
http://take.ms/D9OJ3

Join us on our google analytics community : https://plus.google.com/u/0/communities/100140026864685295841

Hope this helps,
Cheers
Noman karim