In an effort to prevent ghost spam, I am trying to filter traffic by hostname in Google Analytics. I have found several hostnames that appear legitimate, and now the length of these hostnames in regex exceeds the character limit in the Google Analytics filter field.

When I try to create two separate "include" filters (to cover all of these hostnames), they conflict with one another. As a result, my view doesn't register traffic from the set of the hostnames included in Filter 1.

  1. Is there a way to "include" all of these hostnames regardless of the character limitation?

  2. Is there a central repository of "safe" hostnames? I've got www.mysite.com, mysite.com, and subdomain.mysite.com. I've also added translate.googleusercontent.com|webcache.googleusercontent.com|web.archive.org|mysite.com.googleweblight.com|translate.baiducontent.com| mysite.us1.list-manage1.com|ww.mysite.com|www.mysite.toolweuse.com

Other sources I've already reviewed:

Exclude multiple domains in Google Analytics

How to fight off Google Analytics referrer spammers?

Google Analytics - include filter not working

  • So you are only trying to track referrals by a white list? That would rule out seeing any new referrals, even from legitimate links. Sounds like a poor way of hiding spam referrals to me. Jun 22, 2017 at 14:46
  • @StephenOstermiller I am using both referral exclude filters and hostname include filters. The referral filters are meant to block referral spam from known offenders who never hit the site. The hostname include filter is meant to accept traffic from legitimate hostnames. Sources that show this approach: moz.com/blog/… ohow.co/removing-google-analytics-spam help.analyticsedge.com/spam-filter/… Would love a better way (!) but want to start by solving immediate question
    – KDP
    Jun 22, 2017 at 14:52


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.