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.9K members online now
1.9K members online now
Ask questions about filter set-up and issues with using filters in Google Analytics reports
 
Guide Me
star_border
Reply

Cannot filter on custom dimensions

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi, I'm having trouble filtering on custom dimensions. It *looks* like I setup everything as should but in my views I dont see any data coming in.

 

F.e. Im having an "environment" variable which is set to Live on my live site and set to Development on my development site.

 

This is how I set the dimension up:

c1.JPG

Script in the page:

 

c2.jpg

 

Filter:

c3.JPG

 

PS I also tried ^development$ and ^Development$ as patterns.

 

When I refresh the page or load it a few tabs the count remains zero:

c4.JPG

 

The view without the filter shows hits just fine:

c5.JPG

 

Anyone have a clue?

1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Dave d
June 2017

Cannot filter on custom dimensions

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

After weeks of struggeling and 1 hour after posting I found my own answer.

 

The problem is in de order of the javascript. I was adding the dimensions before the create call. I wish google pointed the importance of order out somewhere -_- 

 

Correct order:

ga('create', 'UA-99542170-1', 'auto');
ga('set', 'dimension1', '@Model.Environment');
ga('set', 'dimension2', '@Model.ModuleId');
ga('send', 'pageview');

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Dave d
June 2017

Cannot filter on custom dimensions

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

After weeks of struggeling and 1 hour after posting I found my own answer.

 

The problem is in de order of the javascript. I was adding the dimensions before the create call. I wish google pointed the importance of order out somewhere -_- 

 

Correct order:

ga('create', 'UA-99542170-1', 'auto');
ga('set', 'dimension1', '@Model.Environment');
ga('set', 'dimension2', '@Model.ModuleId');
ga('send', 'pageview');