简体   繁体   中英

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.

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") 

.setFilters takes only one string .setFilters(String, String) gives an error.

Putting 2 lines .setFilters(String1) .setFilters(String2) does not filter the data as desired.

As a work around, I created a segment and put all the filters there and used that segment in my data pull. so working for now but still looking for the filter code

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM