Semalt Expert From Islamabad: A Guide To Blocking Referrer Spam And Ghost Referrals

If you ever see a major spike in the traffic to the website and your Google Analytics account shows spam or low-quality websites, your site may have been trapped by ghost referrals or referrer spam. As this form of spam leaves a significant impact on the account and traffic information you receive, it's essential to check your Google Analytics account and observe what changes should be made.

Sohail Sadiq, a leading specialist of Semalt, provides here some practical issues in this regard.

Introduction to ghost spam and referrer spam:

Referrer spam is the traffic of your website that comes from crawlers and bots and impersonates the referral links or referral visits, while ghost spam does not visit your site and leaves an impression in your Google Analytics account.

Bots and Crawlers:

Crawlers and bots are the robots and web crawlers that visit different websites. Usually, they are considered as harmless and would be used to crawl your web pages and articles. Crawlers and good bots identify themselves as site-friendly and will never show up in the Google Analytics statistics. But bad bots or spiders cannot recognize themselves, so they will recorded by the Google Analytics accounts. They visit your site with cent percent bounce rate and leave the web pages within seconds.

Ghost referrals

The ghost referrals are not site-friendly and can cause serious problems for your website. They do not visit your website and spammers and hackers have found this method to exploit the Google Analytics server. They also spoof the sessions on your website and are spoof the organic events and visits too. Moreover, the ghost referrals often guess the analytics code and trick your Google Analytics into believing that real people have hit your website.

How to block referrer spam and ghost referrals

There are different ways to prevent referrer spam and ghost referrals in your Google Analytics account. The first is to use the filters and the second is to block them altogether.

Filters are an easy way to deny low-quality traffic in the reports. They are easy to create, and the referrals never get recorded once you have added the suspicious websites to your filters.

You can edit the .htaccess file with this code:


RewriteCond %{HTTP_REFERER} exampleI\.com [NC,OR]

RewriteCond %{HTTP_REFERER} exampleII\.com [NC,OR]

RewriteCond %{HTTP_REFERER} darodar\.com [NC,OR]

RewriteRule.*– [F]

This code should be placed along with the URLs you want to eliminate. You can also copy and insert the "RewriteCond" line for all the URLs you may want to block in your Google Analytics account.

Use filters to block the ghost referrals

It's true that blocking through the .htaccess file is easy, but most spammers are smart enough not to let it happen. In such circumstances, you can use filters to block the ghost referrals. There are a number of tutorials to get inspiration from. The first thing you should do is to filter the analytics traffic by the hostname. The ghost referrals and referrer spam show up as invalid hostnames in your Google Analytics account. You should first find their location and block them from the Admin section. Make sure you have blocked all the suspicious websites and ghost referrals using this method.