Mobile app version of vmapp.org
Login or Join
Smith883

: Why does the same regex work in Google Analytics Segments but not Filters? I am using the following regex to exclude spam sites: (social-buttons.com|darodar.com|free-share-buttons.com|buy-cheap-online.info|Get-Free-Traff

@Smith883

Posted in: #AdvancedSegments #Analytics #Filtering #Google #GoogleAnalytics

I am using the following regex to exclude spam sites:

(social-buttons.com|darodar.com|free-share-buttons.com|buy-cheap-online.info|Get-Free-Traffic-Now.com|hol.es|hulfingtonpost.com|googlsucks.com)

When I added a Segment with this filter, I get the desired results. However, when I created a View with a Filter, it didn't filter buy-cheap-online.info. I suspect that as the days go on, it will not filter the other sites. (I understand that Filters are not applied retroactively.)

Why doesn't the same regex work in both Segments and Filters?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Smith883

1 Comments

Sorted by latest first Latest Oldest Best

 

@Berumen354

Your expression should work fine on both is strange that it doesn't for filters. I tested here regex101.com/
Probably the filter hasn't started working yet. Filters may take up to 24hrs for start showing in your stats support.google.com/analytics/answer/6046990?hl=en
GA allows simpler syntax for basic expression, dots and hyphens don't need to be escaped you can write your expression like this

social-buttons.com|darodar.com|free-share-buttons.com|buy-cheap-online.info|Get-Free-Traffic-Now.com|hol.es|hulfingtonpost.com|googlsucks.com


It will work the same and save you some characters

UPDATE: This Expression should be used with Campaign source on the Field type. More information here:
stackoverflow.com/a/28354319/3197362

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme