block referral spam

How to Get Rid of and Other Referrer Spam in Google Analytics

If your website’s Google Analytics has been showing a spike in incoming referral traffic from the likes of,, etc., then it’s highly likely that the web analytics tool has been infected by referral spam. Although it’s not likely to cause any major problem in the short run, the longer you ignore the problem, the greater would be the chance of it actually turning into a full-fledged nuisance.

Why Google Analytics Referral Spam can be a Big Problem?

If you’re among those website owners or marketers who heavily rely on Google Analytics reports such as daily visitors, month visitors, bounce rate, etc. to make important strategic decisions, then you can’t afford to let referral spam wreak havoc in your web analytics tool. You’ll not only be seeing inflated results pertaining to daily and monthly visitors, but may also be looking at a skewed bounce rate. Making crucial decisions based on a data that’s not even accurate than lead to a series of complications right away.

Most Common Culprits of Referral Spam

It is important to understand that the domains being shown as the source of referral traffic may have absolutely no connection with the spam attack on your website’s Google Analytics account. Only their name may be getting used by the actual spammer to make the traffic look less conspicuous. Some of the most common websites that are found in the referral column on an infected Google Analytics account are:


How to Remove Referral Spam from Google Analytics

Now that we’ve described the problem in great detail, it’s time to take a look at how the problem can be dealt with. There are in fact two solutions to the problem, one ideal for advanced users while the second suitable for those who prefer the simpler route.

Before you attempt either solution, make sure you’ve isolated the problem correctly and not accidently considering an innocent website as the source of the problem.

Blocking Spam Bots through .htaccess File

If you’re confident about your web skills, then head over to your website’s .htaccess file, open it. In case you don’t know how to do that, log into your cPanel, click on File Manager, click Document Root for check-box, click on Show hidden files, and finally click Go. You’ll see the .htaccess file. Simply right-click on it and select Code Edit.

Once you’ve done that, paste the following code in there:


RewriteCond %{HTTP_REFERER} Lifehacĸ [NC,OR]

RewriteCond %{HTTP_REFERER} Lifehacĸ

RewriteRule .* – [F]

You can, of course, add additional problematic domains to the list as well to stop them from skewing the Google Analytic results. Do keep in mind that even a single erroneous code in .htaccess can take down your entire website as it directs the behavior of your server. Therefore, think twice before making changes to it.

Using Analytics Filters to Block Referral Spam

Another option to keep the accuracy of your website’s Google Analytics reports intact is by utilizing the filters feature. It lets you exclude traffic results and impact from a certain source or even country.

To use the Google Analytics filter option, click on the Admin tab on your Google Analytics dashboard, then click All Filters, then click New Filter, and then add the problematic domain name in the Filter Name value. Under Filter Type, select Custom, and then select Campaign Source in the Filter Field. In the filter pattern text box, add the name of the problematic domain, and finally click on the Save button.

Leave a Reply