If you are an active internet user, Spam is the most common word you must be hearing. Spam has created its inevitable presence on the internet to affect several users.
But the spam that you see these days comes with two motives. Some spams are keen to access your server space, while others send you destructive viruses.
Referral spam is one such prominent spam that you will find these days. These spams harm your SERP health as they crawl to your Google Analytics. It affects your rankings. The referral spams are even so harmful that it might influence the search engine against you.
So, in such cases, it is necessary for you to be aware of this spam and know ways to fight them back. Although it may not get eliminated, there are some hacks to block these spams.
In today’s blog, you will learn steps to block referral spam in Google Analytics. So, keep on reading without skipping.
Knowing more about referral Spam
The referral Spam is not that difficult to understand! Professionals explain it as an approach to ask for frequent website requests employing a forged referrer URL.
Spammers often send these requests to the website they wish to promote. All the spammers send these referral links with one purpose. It is to target search engines.
So, the spammers come with a website they desire to crawl higher in the search engine rankings. This makes them send many requests that aid them in backlink the website they wish to promote.
The spammers lack useful content on their websites that can boost organic ranking. So, they use referral spam URLs to promote the site. If you don’t know, your website might expose some statistics. It can also access logs linking to the spammer’s site.
As a result, you are now integrating into a site with low-quality content. This will always help the spammers get the ranking, whereas you will start losing rank. Besides, Google also monitors the sites connecting to other junk sites. This will lead to your poor performance in the search engine.
You may never know about the spam referral links, as they disguise your JavaScript tracking code. They extract your analytics insights and other user engagement metrics to use your website.
The meaning behind the name
Some of you might be wondering why they are called referral spam. The reasons behind the name are quite clear here. These kinds of spam get their name from the approach they interact with Google Analytics.
The spammers here use Google Analytics to use other websites to refer to their sites. That is why they are termed referral spam.
You can also have a referral report in your Google Analytics dashboard to know about your traffic incomings. Users who are unaware of your referral report may end up clicking on harmful links.
How can I know my site has referral spam traffic?
If there is an unnatural growth in your website traffic, it indicates spam referrals. You must look for new traffic sources to discover the Google Analytics referral spam.
The fastest & most accurate way to search spam is to check referral traffic in Google Analytics. Now let’s check how many types of Google Analytics referral spam exist.
So, there are two types of spam referral traffic Crawler referrals & Ghost referrals. The crawler referral is a type of spam that visits your site & contaminates the website.
Ghost referrals don’t affect your site traffic but attack the referral Google analytic server. It also impacts the Google Analytics count session & page views.
Both these referral spam are tough to distinguish because they look similar. Well, you need to use different techniques & approaches to block them.
Why is it necessary to block referral spam in Google Analytics?
You may be questioning yourself, does a referral spam a problem? The referral spam doesn’t target you or impact your visitors. So, why is it necessary to remove them or block them?
When your website is hit with referral spam, the traffic increases, which may excite you. Without analyzing data, you think your site is doing good. But deep down somewhere, your site traffic drops down.
Spam referral traffic affects the bounce rate, pages per session, and average time on site. If your only goal is to leverage your site with the huge traffic, the Spam referral traffic might create stress. If the spam stops, the site traffic drops down.
Spam referrals can damage the business’s reputation because of the damaged SEO campaigns. It also contributes to DDoS attacks & can cause site hijacks.
Legitimate experts generate impressive content for their businesses. As a responsible site manager, you must prevent spammers from cutting down poor links from the internet. To get rid of these issues, it would be best to block referral spam in Google Analytics.
What are the most common ways to block referral spam?
Remove the spider and known Bots from the GA setting.
Before you move to any advanced method of blocking spam referrals, let’s start with the built-in option.
Visit Admin> View setting > Bot filter
Click the checkbox & save the page.
Filter spam from the analytic results.
While making any changes technically, you always want to take a backup. It helps to access the information if things are getting wrong.
Similarly, in Google Analytics, you should keep the unfiltered views data to compare it with the filtered data. If any filters don’t work perfectly, you can revert and get a complete view. Let’s check the steps for setting an unfiltered view.
1. Visit to Admin section> View setting
2. Tap on the copy view and then put the naming on the view unfiltered.
3. Get back to the Google Analytics admin page & tap on the filter
4. Click on the Add Filter button
You can set a couple of spam filters to block the spam. Check every filter you create to ensure it works perfectly. Once you are sure, you can click on the Save button.
Edit .htaccess file
If your site uses cPanel hosting, the best way to block referral spam in Google Analytics is to edit the .htaccess file. The file handles controlling the server and instructs to block spam visits from IP addresses and domains.
By editing this file, you can block the referral spam from a website and remove this from your server. Following the below steps, you can improve your server speed.
Ways to block spam referrals in the .htaccess file
For example, here, we want to exclude free traffic.XYZ, Semalt & buttons-for-website.com. Add the following commands on the .htaccess file.
## SITE REFERRAL BLOCK
RewriteCond %{HTTP_REFERER} semalt\.XYZ [NC, OR]
RewriteCond %{HTTP_REFERER} free-traffic\.XYZ [NC, OR]
RewriteCond %{HTTP_REFERER} buttons-for-website\.com [NC,OR]
RewriteRule .* – [F]
Here OR refers to “Many referrers need to be blocked.
NC refers to turning the command’s case sensitive so that the filter can catch Free-Traffic, SeMalT.com.
F indicates fails
While following this step, you should be extra careful. One small mistake can take your website offline.
Ways to block spam referrals in Nginx
If your host uses an Nginx web server rather than Apache, you can’t edit the .htaccess file. In this situation, complete the task by adding the following commands.
if ($http_referer ~* “bad-site-to-block\.com”) {
return 403;}
Use a Third-Party Tool
If your website runs on the WordPress platform, use a plugin for WordPress referral spam. Here you can block the bot traffic.
Sucuri is the ideal option because it tracks referrer spam & eliminates this from the website. This plugin also keeps your site safe from DDoS attacks. Sucuri is a website-security solution.
Instead of Sucuri, you can try some other plugins. But some of the plugins haven’t been upgraded. Using these plugins might not be compatible with you.
Using outdated software can bring other security issues. So, before choosing anyone, be careful. Don’t forget to take a backup before you install a new plugin. Keeping a backup helps you to revert back to the original site if there are any issues.
There are certain things you should keep in your mind.
- Filters can alter the data permanently, so create a new file before any changes.
- Suppose you find any ghost spam in the Google Analytics report. Don’t visit these sites. Some links are harmful, while others can install malware on your system.
- Most spam bots target weak sites. This is why you should choose quality hosting.
- To defend your site from this spam, use a firewall.
Summary
It is impossible to avoid spam completely, but you can control its impact. You can control the impact using the right filter methods and plugins. A person having sound technical knowledge can easily perform the discussed steps.
Referral spas create headaches because it affects the site’s reputation. To preserve your reputation and the trust of customers, take necessary action. Google might take some action on the spam in the upcoming days.
Until then, they discussed ways to manage and cut these. Thank you for sharing your precious time to read this blog. Let us know through comments if you have found something more interesting