Search code examples
regexgoogle-analyticsgoogle-analytics-filters

Google analytics filter displays no traffic


I use two different views with different filters applied to them to differentiate traffic on my site:

  • There's the RAW view with no filters
  • There's the book view which includes traffic to hostname/book

I'd like to include a view with a filter to show only traffic to two subpaths:

  1. hostname/manage.* (i.e. hostname/manage/login)
  2. hostname/[A-Z]{8} (i.e. hostname/AGZBNSTO)

I did this via two custom include filters with the (tested) RegEx expressions above, but although I can for instance see real-time traffic going to hostname/manage/auth/register in RAW view, I can't see anything with the filters applied.

Why is that? Should there only be one filter?

Or is there any better practice to separate traffic to subpaths?


Solution

  • Filters run in the order they are applied, so anything that does not meet the criteria of the first include filter gets discarded, and does not make it to the second include filter that is based on the same Filter Field.

    By default GA only reports the RequestURI portion of a URL. It wont include the Hostname in the Site Content reports unless a filter is used to prepend the Hostname to the RequestURI

    Assuming no other filters are applied to this particular View -
    Create a single custom include filter
    Filter Field: - RequestURI
    Filter Pattern: ^/[A-Z]{8}|manage.*

    NB:- If you have a filter applied to the view that prepends the Hostname to the RequestURIs, the above include filter should still work, but make sure it is placed before the prepend Hostname filter in the View's Filter Order