Advanced Filters with Fields Required/Not Required


On a post way back in April on Custom Advanced Filters, Idris left a comment asking about the required/not required selection (seconded by Paul):

Hey, great articles. I am trying to do some advanced filtering, but I’m confused by the “Field X Required” option. If I say “Yes” to the requirement, which of the following two things does that mean?

a. If the regex in this field does not match, do not include this hit in the profile at all.

b. If the regex in this field does not match, skip this filter, and move on to the next, but still include these hits in the profile.

These two are obviously very different. Which does Google Analytics do?

The confusion is about what exactly is “required”. We were pretty sure we knew, but we did an experiment to confirm. It’s basically b from what Idris suggested.

Here are the details:

  1. If the field is required and the regex matches, the output is written to the field you select.
  2. If the field is required and the regex does not match, the output is not written to the field you select.
  3. If the field is not required, the output is written to the field you select regardless of whether the regex matches.

In no case are the pageviews excluded from the profile entirely (you need an exclude filter for that). The filter just doesn’t apply if the field is required and it doesn’t match.

Jonathan Weber is our Data Evangelist, focusing on bringing the strategic value of data analysis to our customers. He spreads the principles of analytics through our training seminars and even wrote a book on Google Analytics & Tag Manager. Before he caught the analytics bug, he worked in information architecture. Away from the computer, you can find him as a flower farmer and plant geek.

  • Paul

    Thanks for this Jonathan. Thats what I thought it should have been.

    The problem I was having was that a profile I had set up with an advanced custom filter (profile a) seemed to be recieving less traffic than my control profile (no filters). I was sure it should have the same (which matches you findings above). I eventually set up another identical profile (profile b) with the same filter on as a. This time it matched the control exactly for visits etc. I removed all filters from profile a and it is still getting less traffic?????? I can only assume that Google Analytics isn’t entirly free of bugs and errors.

    Thanks for your help.

  • @Paul —

    There are a variety of things that could be affecting what you’re seeing. One really simple thing to make sure of is, make sure you are comparing data for date ranges *after* you made the filter changes (because GA doesn’t change data in profiles retroactively, only from the time you made the change forward). Other than that, you didn’t say what data you were seeing that was different between the profiles, but discrepancies in what you see in these profiles could be due to some other setting that’s different, such as the query parameters you’re stripping.

    In any case, it appears you’ve solved your problem with a new profile, so I’d just stick with the one you know is working correctly…

Contact Us.

Follow Us



We'll get back to you
in ONE business day.
Our Locations
THE FOUNDRY [map] LunaMetrics

24 S. 18th Street
Suite 100

Pittsburgh, PA 15203


4115 N. Ravenswood
Suite 101
Chicago, IL 60613


2100 Manchester Rd.
Building C, Suite 1750
Wheaton, IL 60187