When I looked at Google Analytics, the site's traffic suddenly surged. The main indicator did not increase, but it was strange, so I looked at the referrer.
Traffic from bottraffic4free.club has increased dramatically. Upon entering, you will be redirected to https://www.gammatraffic.com/.
Ah! This is so-called referrer spam. Referrer spam informs where my site has been referred and redirects to another site to promote the site.
When the http protocol requests a document, it also requests the location of the current document, and the web server records it in the log. Google Analytics, such as a website analysis tool, analyzes this as a reference site, and uses this principle to send spam to the referrer. This guy's marketing makes good use of technology as well.
After the creation of the Internet, so-called spam mail, which is an offline advertising letter, appeared on the Internet as it is. It wasn't until several decades later that a law was passed that required prior consent in each country. However, such spam traffic is not yet regulated. Search engines crawl around the site, there is only etiquette of robot. Regulating search engine crawling and revenue from portals and search engines are also old issues.
Traffic through this spam wrapper not only prevents administrators from seeing the traffic properly, but also places a load on the web server.
Web hosting usually pays for hard capacity and traffic capacity, so if spam traffic runs out of traffic for my normal users, or if it's not a pay-as-you-go system, it may cost more.
So I did two things:
- How to disable spam referrer filter in google analytics
- Block access to the web server
Filtering Spam Referrers in Google Analytics
Google Analytics allows you to filter. However, it does not apply to existing data, but only to new traffic. It's really inconvenient because it's not retroactive.
Exclude by domain name
- In the Google Analytics admin menu, tap the filter for the view.
- Create a filter by clicking 'Add Filter' in the filter list
- As in the following screen, set the flutter type to custom and enter the name from the referrer in the campaign source.
You can create one filter at a time, but there is a limit to the number of filters you can create. So you can still add it to your filter pattern in the form of a regular expression.
Exclude by IP
It can also be blocked by IP. Similarly, multiple IPs can be entered.
Block IP from entering the web server
If you cheat a user agent like a search engine, you can also do it in robots.txt, but this is referrer spam, so you can block ip.
When I ping bottraffic4free.club, the IP is 220.127.116.11. I don't know when it will change, but I stopped it for now.
blocking with .htaccess
Open the .htaccess file in your directory, create it if it doesn't exist and add the following:
Order Allow, Deny
Allow from all
Deny from 18.104.22.168
If you do this, the sender cannot connect because the web server blocks it, so you can change the ip to enter. Well, with security, spears and shields, we have no choice but to respond to each other.
I learned this from a spam referrer from Russia after I installed Google Analytics on my company site before, and it still seems to work.