11

The issue is that i need to filter around 100 analytics URIs which is located in database(lets say most important pages of site), it can be queried one by one but i think it is not efficient. The goal is to filter all URIs at once. instead of

filters=ga:pagePath==/firstURI

i need some thing like

filters=ga:pagePath==/firstURI && /secondURI && /thirdURI && /...URI

I have played with http://ga-dev-tools.appspot.com/explorer/?csw=1 and searched documentation about it, but couldn't find anything! I hope you will be able to help me!

user1418998
  • 595
  • 4
  • 18

2 Answers2

24

After very long and unpleasant play with Google Analytics Query Explorer 2 i came with solution like this one which does right job.

filters=ga:pagePath==/firstURI,ga:pagePath==/secondURI

IMPORTANT NO SPACES between filters

Reference Documentation

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. OR

The OR operator is defined using a comma (,). It takes precedence over the AND operator and may NOT be used to combine dimensions and metrics in the same expression.

Examples: (each must be URL encoded)

Country is either (United States OR Canada): ga:country==United%20States,ga:country==Canada

Firefox users on (Windows OR Macintosh) operating systems: ga:browser==Firefox;ga:operatingSystem==Windows,ga:operatingSystem==Macintosh AND

The AND operator is defined using a semi-colon (;). It is preceded by the OR operator and CAN be used to combine dimensions and metrics in the same expression.

Examples: (each must be URL encoded)

Country is United States AND the browser is Firefox: ga:country==United%20States;ga:browser==Firefox

Country is United States AND language does not start with 'en': ga:country==United%20States;ga:language!~^en.*

Operating system is (Windows OR Macintosh) AND browser is (Firefox OR Chrome): ga:operatingSystem==Windows,ga:operatingSystem==Macintosh;

ga:browser==Firefox,ga:browser==Chrome

Country is United States AND visits are greater than 5: ga:country==United%20States;ga:visits>5

user1418998
  • 595
  • 4
  • 18
2

I was able to accomplish this using regex and the Destination Page dimension:

ga:searchDestinationPage=~^(pagePath1|pagePath2|pagePath3)

Remember that a hat (^) in regex means to start at the beginning of the string, which means you need to be sure to include any leading slashes (/) in your page path entries.

Preston
  • 31
  • 3