Search code examples
javagoogle-analyticsgoogle-analytics-api

Combining Two Condition Sets by OR,AND operators in Google Analytics Data Query Filter


I want to combine two separate sets of conditions,like (A) OR (B AND c AND d) in Google Analytics Data Query Filter This is what i want

exclude all visits:

*coming from the US*

OR

*`coming from source=xyz AND medium=pqr AND keyword contaning 'abc'`*

i am currently tyring to use this query but it's not working

"a:country!=United States,ga:source!=xyz;ga:medium!=pqr;ga:keyword!=abc"

please help me out with this.


Solution

  • I got the answer for this just set the segment and filter criteria as follow

    segment = dynamic::ga:country!=United States
    

    and

    filter = ga:source!=xyz,ga:medium!=pqr,ga:keyword!=key1;ga:keyword!=key2
    

    that's work for me thank you all