The best way to prevent ghost referrer spam is by creating the filters or editing your.htaccess file. You can create as many filters as you want to prevent the suspicious hits from ruining your Google Analytics data.