I was trying to add custom filter in Google Analytics to stop spam traffic using regular expressions. But not sure for below domains, which regular expression I need to use.

  1. abc.xyz
  2. reddit.com/r/technology
  3. addons.mozilla.org
  4. boltalko.xyz

Please help


for mine, I select a Custom filter, select referrer, and then I just use the main domain bit like


But if you need to use a .com bit, then make sure to escape it with a backslash

  • Thanks for help James. Much appreciated. Is it need to put space in between domain name and before using or expression like abc\.xyz| or abc \ . xyz | – Ankush Mahajan Dec 3 '16 at 7:27
  • I don't think a space is required for that. I don't use spaces in mine. – semaj0 Dec 5 '16 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.