Before we get into how filter referral spam from your Google Analytics, I want to make something clear. Filtering referral spam is NOT the same thing as blocking it.
Filtering it out is simply masking it from your analytics data, but make no mistake it is still hitting your sight and ruining your analytics.
Who Should Filter Out Referral Spam From Google Analytics
Someone who doesn't want to mess with their htaccess file.
If blocking referral spam via your htaccess file (lesson 3) is to technical and you want to see your sites performance data, then your best bet is to filter your data.
When spam referral data is included in your analytics it makes it very difficult to make judgments about how to handle your website.
For example:
If my site got 10 visits today from 1 real person (who viewed two pages) and 9 spam referrals (that viewed 1 page). My bounce rate would be 90%
If I filtered out the spam referrals, then I only had 1 visitor and my bounce rate would be 0%.
When you get into trying to fix your website and figure out how real humans are interacting with it, it's helpful to look at accurate data so you can make better informed decisions,
How To Make A Google Analytics Spam Filter
Inside of your Google Analytics account navigate to Admin -> Filter-> New Filter
Name Your Filter and Create a Custom Exclude for Campaign Source. next you need to add the sites you want to filter into the filter pattern. The format is domain./ followed by a pipe (|) for each domain.
here is what mine looks like:
semalt\.|buttons-for-website|7makemoneyonline|ranksonic\.|simple-share-buttons\.|social-buttons\.darodar\.
So now going forward, this will filter out all of these site hits from your Google Analytics. Just a reminder, DON't BE FOOLED, this is not blocking them, you are just no longer seeing them.
I have personally turned my Google Analytics filter off, simply because I want to know the size of the problem.
You can't manage, what you can't measure.