The skills we teach deliver real ROI.

How to Use Segments and Filters in Google Analytics


There’s a big difference between segments and filters in analytics.  Segments let you change the view of the data during your session without making permanent changes.  Filters (done in the Admin section of your account) result in permanent changes to your data.  There is also an inline filter that you can use in reports that does not change data permanently.  (I wish Google would change this terminology because it confuses people).

Uses for segments:

Segments are found at the top of your Google Analytics screen and can be applied to any of the reports without changing data permanently.  They also work immediately so you can view your subset of data as soon as you apply the filter.  The use of “advanced” makes it sound more complicated than it really is.  Think of advanced as the data permutations available to you in the segment and not the complexity of the tool.

  • Big spenders - If you have an e-commerce site, revenue is a logical segment to use.  Assuming anything over $500 is a good amount of sales for your site, you can set a segment to view “Revenue > $500” and learn about the type of visitor that spends that amount.
  • Segment mobile visitors by desktop visitors - As mobile continues to grow, it’s important to know if their behavior is any different than those coming from a desktop.
  • Activity by hour of day – You can view conversions by time of day by selecting the hour someone was on the site taking action.  If most of your visitors convert between 9am and 5pm that may be the best time to post on social media and run paid ads.

The great thing about segments is the ability to see how it impacts data immediately.

So why use a filter?

You would apply a filter to a view if you know there is something you want to look at long-term without applying a segment every time you go into the data.  The clear example is excluding internal office traffic.  You may not ever want to see how your office staff interacts with your website.filter

In addition to the predefined filter types, which you can use with your domain, hostname, subdirectory and IP address, there are also custom view filters.  Here are some examples:

  • Include traffic that meets a certain criteria, such as campaign medium. This is useful if you want a user to view only a segment of data and not have access to the whole account.
  • Convert everything to lowercase, which is helpful when tagging was not done consistently, such as “cpc” vs “CPC”.  Users will identify those as the same thing, but Google will view them differently.
  • Search & Replace a specific pattern in an analytics field.  It could be because of the site design or use of dynamic URLs. If a page on your site is, that is not very meaningful for reporting. If that brings them to a services page on your website, you can do a search for /lkjsjl?abc and replace it with /Services so your data is easy to read.

robotThe more recent use case for filters is due to the increase in spam referrals.  Google does offer an option to exclude “all hits from known bots and spiders”.  If you are an Administrator in your account, you can find this in “View Settings”.  However, this unfortunately does not work for many of the other bots and spam referrers out there.  The good news is there is a comprehensive list of the spam culprits. The bad news is that there are a lot of them.  Each filter you use to exclude spam can only be 255 characters long, which means multiple filters need to be applied to exclude all the sites that keep coming up.  Also, keep in mind this is only good on data moving forward.  It does not get rid of those historical spam visits. Google is working on a solution to this referrer spam, but there is no release date yet.

What’s worse is that spam URLs are also starting to show up in content reports for your site in Google Analytics, making it appear as if these URLs are part of your website.  To get rid of these, you can create a filter for a hostname that matches the regex for your website address.  For example, it would be a hostname that is| None of these solutions for dealing with spam URLs are ideal, but it will at least give you clean data until a better solution is released by Google.

If you are interested in learning more about segments and filters, sign up for a free webinar “How to Use Segments and Filters in Google Analytics” on July 15th.


Leave a reply