How to Stop Spam in Google Analytics
There are several types of spam visits to the site with which users contact us. These visits are clearly visible in Google Analytics.
1. A lot of referral traffic with a 100% Bounce Rate and a visit duration of 0-1 sec.
2. Direct entrances to the site with a 100% Bounce Rate and a visit duration of 0-1 sec.
Why does Google analytics calculate metrics this way? According to google help https://support.google.com/analytics/answer/1009409
if only one page was visited and the user left it without performing any interactions, then Google cannot calculate the visit time.
Bounce Rate - this is one visit to the site, without going to any other page or site.
Potentially, that all these visits were made to only one page of the site and without any other interactions.
If you do not have many such visits, then these may be ordinary users.
But in cases where your number of visits to referral or direct entrances has sharply increased, then this may be spam visits.
There is a lot of referral traffic with 100% bounce rates and a visit duration of 0-1 sec.
If you look at the statistics and find that your number of visits from various sites or from social networks has increased, and these visits have a 100% bounce rate, then most likely this is referral spam.
In this case, you probably will not get real visits to your site. Spammers sent data to Google analytics directly and there were no real visits to the site. You can check this by looking at the webserver logs. You can also install CleanTalk Security Plugin for WordPress or Universal Security plugin for other CMS. In the security statistics, you will receive data on all visits to your website, even those that are not tracked by Google Analytics, including bots. https://cleantalk.org/help/security-features
In most cases, referral spam is sent via the Measurement Protocol in Google Analytics. It appears even when you just create a counter for a site that does not yet exist.
Spammers just iterate over the identifier values in order.
What are the disadvantages of such attacks, the first and the most obvious is garbage in your statistics, you will not see real indicators. Second, many believe that this can affect SEO and worsen the behavioral parameters of users on the site, which ultimately can lead to a decrease in the position in the search. But this is not so, Google released an explanation on the influence of Google Analytics data a factor in a page's ranking
What solutions can there be?
If this does not cause problems with statistics and data analysis, then you can do nothing.
Obviously, installing any plugins on the site itself will not solve this problem, since traffic does not even reach the site.
The only solution is to use Google Analytics filtering tools.
You can find instructions on how to set up Google Analytics filters for such queries:
eliminate spam traffic in Google Analytics
How to Stop Google Analytics Spam
How to Remove Referral Spam in Your Google Analytics
The most efficient method is to set up a new custom dimension but you can use any other type of filter.