3.5K members online now
3.5K members online now
Welcome to the Official Google Analytics Solutions Community
Find optimization tips and how-to guides written by the Google team and other experts
star_border
Top Contributor

Filters vs. segments

google-analytics-filter-julien-coquet.png There have been quite a few questions on this forum about Google Analytics filters and segments, with quite a few misconceptions.

This short article is meant to be a basic primer on Google Analytics filters and segments.

[more advanced articles on both topics will be made available shortly]


Filters and segments in Google Analytics are two techniques used to select data to be shown in reports.
They work very differently and it is important to know the difference between the two techniques before configuring and using them.

 

 

 

Filters

Filters change the way data is collected in a Google Analytics view. They are used primarily to include or exclude data from a view but advanced uses include sophisticated search/replace operations, rewriting and formatting of data fields.
Once that filtered data is collected, it is “set in stone” and then processed into the reports you access via the reporting interface.


/!\ Because data in Google Analytics cannot be (re-)processed retroactively (save in very rare cases), a best practice is to keep a “raw data” unfiltered view in your Google Analytics property. That raw data view can be used as a "canary" to identify faults/bugs in your data collection or site sections that can be filtered out into their own view.

 

Another best practice is to add an annotation in your view to point out when a specific filter was applied; this helps your team members know of important changes to your view.

 

It should be noted that filters can only be used with Modify access rights and that filters can be re-used on different views in the account or property. This means that you may not be able to set and use filters. Also, filters are executed in a specific order so pay attention to your filter conditions.

 

Further caveats: knowing regular expressions can come in handy but don't worry too much, basic filters are provided with "wizard"-style settings.

 

For reference on filters, please read: https://support.google.com/analytics/answer/1033162?hl=en

 

Segments
Segments are a way to isolate a sub-set of your visitors (users) or visits (sessions) based on behavioural parameters such as geography, visit recency or conversion abandonment for instance. Once applied, a segment only shows the part of the traffic that matches the specified user or session behaviour.

 

google analytics segment julien coquet.png

 

 

Segments work differently than filters in that they apply to all existing data in your view. They work in read-only mode so you can create as many segments without risking to destroy/corrupt data going forward.

 

A great test segment is to select the built-in (system) segment “Non-bounced sessions” and compare it to the default “All sessions” segment for insights on actual time spent on site and site engagement.

 

You can create up to 100 segments per user account so try them out and experiment!

 

For reference on segments; please read: https://support.google.com/analytics/answer/3123951?hl=en

 

In conclusion

As you noticed from these explanations, filters should be used for data preparation purposes, whereas segments are meant as a way to focus on different session or user behaviours to highlight patterns and insights. Unless you are a power user and/or admin, just use segments for reporting and analysis.

about Julien Coquet

15+ years in web/digital analytics consulting, evangelist for Hub'Scan, an analytics tag quality assurance solution.

Comments
Joshua R Rising Star
January 2017

Great article @Julien Coquet , not enough people appreciate the importance of the difference between filters and segments. Personally i like to tell people that they should always create a backup view incase they apply a filter that prevents important from being recorded and if they lack one of those, then to simply use segments. 

ko l
January 2017

Julien Coquet wrote:

google-analytics-filter-julien-coquet.png There have been quite a few questions on this forum about Google Analytics filters and segments, with quite a few misconceptions.

This short article is meant to be a basic primer on Google Analytics filters and segments.

[more advanced articles on both topics will be made available shortly]


Filters and segments in Google Analytics are two techniques used to select data to be shown in reports.
They work very differently and it is important to know the difference between the two techniques before configuring and using them.

 

 

 

Filters

Filters change the way data is collected in a Google Analytics view. They are used primarily to include or exclude data from a view but advanced uses include sophisticated search/replace operations, rewriting and formatting of data fields.
Once that filtered data is collected, it is “set in stone” and then processed into the reports you access via the reporting interface.


/!\ Because data in Google Analytics cannot be (re-)processed retroactively (save in very rare cases), a best practice is to keep a “raw data” unfiltered view in your Google Analytics property. That raw data view can be used as a "canary" to identify faults/bugs in your data collection or site sections that can be filtered out into their own view.

 

Another best practice is to add an annotation in your view to point out when a specific filter was applied; this helps your team members know of important changes to your view.

 

It should be noted that filters can only be used with Modify access rights and that filters can be re-used on different views in the account or property. This means that you may not be able to set and use filters. Also, filters are executed in a specific order so pay attention to your filter conditions.

 

Further caveats: knowing regular expressions can come in handy but don't worry too much, basic filters are provided with "wizard"-style settings.

 

For reference on filters, please read: https://support.google.com/analytics/answer/1033162?hl=en

 

Segments
Segments are a way to isolate a sub-set of your visitors (users) or visits (sessions) based on behavioural parameters such as geography, visit recency or conversion abandonment for instance. Once applied, a segment only shows the part of the traffic that matches the specified user or session behaviour.

 

google analytics segment julien coquet.png

 

 

Segments work differently than filters in that they apply to all existing data in your view. They work in read-only mode so you can create as many segments without risking to destroy/corrupt data going forward.

 

A great test segment is to select the built-in (system) segment “Non-bounced sessions” and compare it to the default “All sessions” segment for insights on actual time spent on site and site engagement.

 

You can create up to 100 segments per user account so try them out and experiment!

 

For reference on segments; please read: https://support.google.com/analytics/answer/3123951?hl=en

 

In conclusion

As you noticed from these explanations, filters should be used for data preparation purposes, whereas segments are meant as a way to focus on different session or user behaviours to highlight patterns and insights. Unless you are a power user and/or admin, just use segments for reporting and analysis.



min ko lat


Julien Coquet wrote:

google-analytics-filter-julien-coquet.png There have been quite a few questions on this forum about Google Analytics filters and segments, with quite a few misconceptions.

This short article is meant to be a basic primer on Google Analytics filters and segments.

[more advanced articles on both topics will be made available shortly]


Filters and segments in Google Analytics are two techniques used to select data to be shown in reports.
They work very differently and it is important to know the difference between the two techniques before configuring and using them.

 

 

 

Filters

Filters change the way data is collected in a Google Analytics view. They are used primarily to include or exclude data from a view but advanced uses include sophisticated search/replace operations, rewriting and formatting of data fields.
Once that filtered data is collected, it is “set in stone” and then processed into the reports you access via the reporting interface.


/!\ Because data in Google Analytics cannot be (re-)processed retroactively (save in very rare cases), a best practice is to keep a “raw data” unfiltered view in your Google Analytics property. That raw data view can be used as a "canary" to identify faults/bugs in your data collection or site sections that can be filtered out into their own view.

 

Another best practice is to add an annotation in your view to point out when a specific filter was applied; this helps your team members know of important changes to your view.

 

It should be noted that filters can only be used with Modify access rights and that filters can be re-used on different views in the account or property. This means that you may not be able to set and use filters. Also, filters are executed in a specific order so pay attention to your filter conditions.

 

Further caveats: knowing regular expressions can come in handy but don't worry too much, basic filters are provided with "wizard"-style settings.

 

For reference on filters, please read: https://support.google.com/analytics/answer/1033162?hl=en

 

Segments
Segments are a way to isolate a sub-set of your visitors (users) or visits (sessions) based on behavioural parameters such as geography, visit recency or conversion abandonment for instance. Once applied, a segment only shows the part of the traffic that matches the specified user or session behaviour.

 

google analytics segment julien coquet.png

 

 

Segments work differently than filters in that they apply to all existing data in your view. They work in read-only mode so you can create as many segments without risking to destroy/corrupt data going forward.

 

A great test segment is to select the built-in (system) segment “Non-bounced sessions” and compare it to the default “All sessions” segment for insights on actual time spent on site and site engagement.

 

You can create up to 100 segments per user account so try them out and experiment!

 

For reference on segments; please read: https://support.google.com/analytics/answer/3123951?hl=en

 

In conclusion

As you noticed from these explanations, filters should be used for data preparation purposes, whereas segments are meant as a way to focus on different session or user behaviours to highlight patterns and insights. Unless you are a power user and/or admin, just use segments for reporting and analysis.


 

Caleb R
1w - last edited 1w

What is the difference then between "local" filters and advanced segments?

 

For this post, I use "local filter" to refer to filters applied to dimensions and metrics that have already been processed by GA, rather than filters that are applied at the view level. For example:WidgetFilters.png

Let me provide a specific example of a problem I'm encountering. I have the following two scenarios set up. I would expect the data (pageviews, bounce rate, etc) in both scenarios would be the same. Why aren't they the same? Date range for both: January 2018 vs January 2017

 

You can see that in Scenario 1, the data shows:

56,352 pageviews for 2018

59,251 pageviews for 2017

 

Scenario 2 shows:

56,224 pageviews for 2018 (not too far off. I'm okay with this difference)

52,799 pageviews for 2017

 

Scenario 1: Widgets on a custom dashboard using local filtersPageviewsWidget.png

Local filters are:

Metric: Pageviews

Filters:

Don't show Page RegEx account|paynow|\/examplepage\.htm

Don't show Source exampledomain\.com|relateddomain\.com

 

Scenario 2:  Behavior > Site Content > All Pages report using Segment

Segment.png

 

 

Segment conditions are:

1. Filter sessions exclude page matches regex account|paynow|\/examplepage\.htm

2. Filter sessions exclude source matches regex exampledomain\.com|relateddomain\.comConditions.png