Skip to content

Instantly share code, notes, and snippets.

@hmngwy
Last active August 29, 2015 14:25
Show Gist options
  • Save hmngwy/f2e9f13496ee67b52b0a to your computer and use it in GitHub Desktop.
Save hmngwy/f2e9f13496ee67b52b0a to your computer and use it in GitHub Desktop.

Regular Expressions for Google Analytics filters as of July 24, 2015

Based on the list at OHow and some from Ben Travis.

I would've used the 3 expressions at Travis' post but I don't have the time to check what they cover exactly, so I just carpet bombed it using the list from OHow.

It's split into 4 because of the 255 character limit.

Usage

If you're not sure how to use this follow the first or second link above, in the second link Ben makes a thorough explanation how to use this to filter both historical and incoming data, in the first link OHow goes through how you can make or update these expressions.

Test

The concatenated version of the regular expression is in the link below, this page will show/demo that it catch all the items listed from OHow at the time of posting:

https://regex101.com/r/tK3gU3/1

Disclaimer

Please use the verify link/button to make sure this isn't removing any valid data from your Analytics view.

I will not be liable for any loss in data. Use at your own risk.

.*((social|(simple|free|floating)\-share)\-buttons\.com|e\-buyeasy\.com|wp(securitycheck|themedetector)\.co\.uk|erot\.co|webmonetizer\.net|howtostopreferralspam\.eu|trafficmonetizer?\.org|непереводимая\.рф|websites\-reviews\.com|sanjosestartups\.com).*
.*(4webmasters\.org|aliexpress\.com|event\-tracking\.com|webmaster\-traffic\.com|vitaly|torture\.ml|amanda\-porn\.ga|generalporn\.org|\-porn\.ga|\-forum\.ga|\-free\-traffic\.ga|buy\-cheap\-online\.info|get\-free\-traffic\-now|googlsucks\.com|o\-o\.).*
.*(humanorightswatch\.org|bestwebsitesawards\.com|resellerclub|smailik\.org|darodar\.com|hulfingtonpost\.com|blackhatworth\.com|(buttons|videos|buttons)\-for(\-your)?\-(website|business)\.com|success\-seo\.com|semalt|best\-seo\-(solution|offer)).*
.*(dailyrank\.net|sitevaluation\.org|100dollars\-seo\.com|forum69\.info|makemoneyonline\.com|anticrawler\.org|baixar\-musicas\-gratis\.com|descargar\-musica\-gratis\.net).*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment