Analytics
3.4K members online now
Understand information in your reports and troubleshoot reporting issues such as self-referrals, (not set) data, and inaccurate information
 
Guide Me
star_border
Reply

Custom dimension not showing up in report

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello,

 

I have a property with 3 view (1 global, 1 for a mobile app and 1 for a website).

On the website, I'm using Universal Analytics tag and I've set up (in property configuration) a session-based custom dimension (for segmenting anonymous & connected users) and implemented the correct tracking code :

 

<script type='text/javascript'>
(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', 'UA-XXXXX-XXXX', 'mydomain.com');
ga('require', 'displayfeatures');
ga('set', 'dimension1', logged ? 'registered' : 'anonymous');
ga('send', 'pageview', '/level1/level2');
</script>

 

In GA Tag Manager Chrome extension, everything looks green/fine, I even see the custom dimension.

 

But in Google Analytics Custom dimension report (https://www.google.com/analytics/web/?hl=fr&pli=1#report/visitors-custom-variables/), there is no custom dimension displayed.

My setup is running since several months.

 

Thank you for your help

1 Expert replyverified_user

Re: Custom dimension not showing up in report

Top Contributor
# 2
Top Contributor
Hi Benjamin,

I'm wondering about the dimension line in your code - the 'logged' condition. Is that Google-supported syntax? Maybe I'm not aware of this. Where is the logged value coming from?

Christoph

Re: Custom dimension not showing up in report

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hello Christophe,

The 'logged" condition is a javascript variable (a boolean) which is defined in my own code.

If you want, you could replace with :
var dimensionValue = logged ? 'registered' : 'anonymous';
ga('set', 'dimension1', dimensionValue);

Thank you

Re: Custom dimension not showing up in report

Top Contributor
# 4
Top Contributor
Okay - so, variable 'logged' is given in some previous JavaScript code if users are logged in, and else missing?

Do you see the value of dimension1(registered or anonymous) in Google Tag Assistant?

Re: Custom dimension not showing up in report

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
Yes, I do see the value of dimenson1 in Google Tag Assistant

Re: Custom dimension not showing up in report

Top Contributor
# 6
Top Contributor
Hi Benjamin,

strange enough. You should definitely see them in audience > custom > custom variables report: Dimension 'Custom Variable (Key 1)' with secondary dimension 'Custom Variable (Value 01)'.

Any filters running in that it that Analytics view?

Christoph

Re: Custom dimension not showing up in report

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭
Yes an Exclude filter on field "Application?" (in order to separate mobileapp & webapp traffic).
But even on the unfiltered default view, I don't see the custom variable.