Go to the "Admin" section of your Google Analytics (GA) account.

Choose

  • "VIEW"
  • "PERSONAL TOOLS & ASSETS"
    • "Segments"

Press "NEW SEGMENT" button and give your segment a name, e. g. "Sessions with no ref spam".

Click on

  • "Advanced"
    • "Conditions"

The first line of the Filter shoud be "Sessions" and "Exclude".

From the dropdown below "Sessions" choose

  • "Acquisition"
    • "Source"

From the dropdown below "Exclude" choose "matches regex".

Add the regular expression into text field.

Press "Save" button near segment name and you are ready to use this segment.

Your segment settins should look like this:

Screenshot