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

1 Answer 1


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 | Commented Dec 3, 2016 at 7:27
  • I don't think a space is required for that. I don't use spaces in mine.
    – semaj0
    Commented Dec 5, 2016 at 14:36

Your Answer

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

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