How to Block Google Analytics Referral Spam

When you see as a referral in your Google Analytics Panel. This is referral spam, and it confuses and messes up your Google Analytics reports. The referral spam coming from different countries, for what we have seen its most of the time Russia, but other countries are also possible.

This referral spammers only target your Google Analytics reports and alter those in such a way that you think the visitations are coming from the spamming website. Actually, this never happens there is no visiting to your website, it’s Ghost Spam. 

And luckily it also does not affect your bandwidth traffic. Their main purpose is to see this in your Google Analytics dashboard, be curious and visit their website.

How to Block Google Analytics Referral Spam

  • Open your Google Analytics Dashboard
  • You will see the referral spam point to your index homepage

  • Goto Admin in the Google Analytics Dashboard

  • Select All Filters from the Account you wish the referral spam to be removed from reports.

  • Select Add Filter

  • In the Filter Name enter the exact URL the referral spam is coming from.
  • Choose Filter Type: Custom
  • Choose Filter Field: Campaign Source
  • At the end of the Dashboard select the blue Save button

Block Referral Spam coming from using the .HTACCESS file

  1. Log into cPanel.
  2. In the Files section, click on the File Manager icon.
  3. Check the box for Document Root for and select the domain name you wish to access from the drop-down menu.
  4. Make sure Show Hidden Files (dotfiles)” is checked.
  5. Click Go. …
  6. Look for the .htaccess file in the list of files.

Add the following to your .htaccess file.

RewriteCond %{HTTP_REFERER} [NC,OR]
RewriteCond %{HTTP_REFERER}
RewriteRule .* - [F]

About The Author