It's been a couple of days and I am seeing entries like this on GA. How can I avoid such entries beside analytics_test?
-
1This related question might be helpful, it shows how to set up a filter: webmasters.stackexchange.com/questions/56713/…– dan ♦Commented Mar 10, 2016 at 7:10
-
See also webmasters.stackexchange.com/questions/28994/… and webmasters.stackexchange.com/questions/103222/…– cawCommented Apr 27, 2020 at 12:51
2 Answers
Many of these can be eliminated with a hostname filter.
Open up filters for your domain and add a 'custom' filter, that only includes hostnames with your domain in them. For standard websites, there are no circumstances under which this would filter normal traffic - as all of them are viewing your content on your domain.
-
Will it not block all Referrals including legitimate one?– Volatil3Commented Mar 14, 2016 at 16:24
-
Hostname is set by the domain you're browsing on. All these fakes tend to be sent to random GA numbers and set hostname to their own domain. Unless you've got an iFrame, browsers should always be viewing your site on your domain. There's also situations with CDNs where this might muck up - but this generally only affects assets rather than the page. For 90% of pages this will have no effect on genuine traffic.– L MartinCommented Mar 14, 2016 at 17:12
-
And another example I just remembered: this can mess with cross-domain tracking!– L MartinCommented Mar 14, 2016 at 17:25
Ah yes, the dreaded yet pervasive Referral Spam technique. Google Analytics tries to automatically remove referral spam, but doesn't catch all of it.
There isn't a good solution to this, currently.
Option 1 is to add the domain to an Exclude filter when you see it...OR...you can apply an .htaccess rule to ignore traffic from the referring hostname. This requires frequent maintenance, unfortunately.
Option 2 is to use an Include filter on your valid hostnames, but this won't work if the referral spam bot uses the measurement protocol or if it requests content from your site.
Here's a frequently updated article that mentions some different solutions, e.g. plugins and SaaS services: https://raventools.com/blog/stop-referrer-spam/
Google Analytics isn't the only product affected by this, btw.