Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to apply multiple filters in google analytics

How to filter multiple dimensions in Google analytics.

Nether of the following work:

 .setFilters("ga:userType==anonymous").setFilters( "ga:dimension3==1234")
 .setFilters("ga:userType==anonymous","ga:dimension3==1234") 

The second one gives an error.

like image 742
Nee K Avatar asked Oct 28 '15 05:10

Nee K


1 Answers

You need to string them together.

Combining Filters Filters can be combined using OR and AND boolean logic. This allows you to effectively extend the 128 character limit of a filter expression.

The OR operator is defined using a comma (,).

ga:country==United%20States,ga:country==Canada

The AND operator is defined using a semi-colon (;).

ga:country==United%20States;ga:browser==Firefox

I am not sure what language that is but its probably going to be more like

setFilters("ga:userType==anonymous,ga:dimension3==1234") 
like image 182
DaImTo Avatar answered Oct 16 '22 06:10

DaImTo