1. Home
  2. Knowledge Base
  3. Google Analytics [UA + GA4]
  4. [Desktop] – How to define a filter in a Google Analytics query

Queries are defined using the Google Analytics Query Wizard in Analytics Canvas.  The visual interface lets you choose dimensions and metrics to pull from the API and lets you define report criteria such as time period, segment, filter, sort order, as well as additional data such as profile name and sampling level.

Before defining a filter, check out our post on The Key Difference Between Segments and Filters and make sure a filter is what you’re really after. If so, there are a few simple steps.

Defining the Filter


  1. Select a query to create or edit.
  2. Select “Filter”
  3. Define the filter
    • 3a. Choose the dimension to filter on
    • 3b. Choose the criteria
    • 3c. Enter the string or REGEX function

You can define Regex matches or broader ‘contains’ matches to help you get the right data into your result set.  Click the “Add Filter Expression” button to continue adding more criteria based on boolean search operators (and / or) to include multiple criteria in your filter.Let’s say you only want to include pages that follow the path yourdomain.com/blog/{include everything from here onwards}. You would enter the following as your filter expression:

  • 3a. Dimension to filter on: pagePath
  • 3b. Criteria: Regex match
  • 3c. REGEX function: ^/blog/.\/*

Still need help?  Reach out to us at support@analyticscanvas.com with your specific question and we will get back to you within 24 hours.

Was this article helpful?

Related Tutorials/Video