
Referrer SPAM List: How to Remove Referral Spam from Google Analytics Reporting
Have you ever checked your Google Analytics reports only to find some very strange referrers popping up in the reports? You go to their site and there’s no mention of you but there are a ton of other offers there. Guess what? Those people never actually referred traffic to your site.
Ever.
If you didn’t realize how Google Analytics worked, basically a pixel is added to every page load that grabs a ton of data and sends it to Google’s Analytics engine. Google Analytics then deciphers the data and organizes it neatly into the reports that you’re looking at. No magic there!
But some idiotic spamming companies have deconstructed the Google Analytics pixel path and now fake the path and hit your Google Analytics instance. They get the UA code from the script that you have embedded in the page and then, from their server, they simply hit GA servers over and over until they begin popping up on your referral reports.
It’s truly evil because they never even initiated the visit from your site! In other words, there’s no means for your site to actually block them. I went around and around on this with our host who patiently explained what they were doing over and over and over until it got through my thick skull. It’s called a ghost referral or ghost referrer since they never actually touch your site at any time.
In all honesty, I’m still not sure why Google hasn’t simply started maintaining a database of referral spammers. What a great feature that would be for their platform. Since no visit actually occurs, these spammers are wreaking havoc with your reports. For one of our clients, referrer spam makes up over 13% of all of their site visits!
Create a Segment in Google Analytics that Blocks Referrer Spammers
- Sign in to your Google Analytics account.
- Open the View that includes the reports you want to use.
- Click the Reporting tab, then open the report you want.
- At the top of your report, click + Add Segment
- Name the segment All Traffic (No Spam)
- In your conditions, be sure to state exclude with source matches regex.

- There’s an updated list of referrer spammers on Github that Piwik users are using and it’s pretty good. I’m pulling that list automatically below and formatting it properly with an OR statement after each domain (you can copy and paste it from the text area below into Google Analytics):
- Save the segment and it’s available to every property within your account.
You’ll see tons of server scripts and plugins out there to try and block referral spammers from your site. Don’t bother using them… remember that these weren’t actual visits to your site. The scripts these folks are using faked the GA pixel directly from their server and never even came to yours!
Thank you for these tips. It has been annoying to have it on my stats.
You bet. We’ve updated the correct solution to this since the referral spammers aren’t actually even coming to your site.
Hi Douglas,
We had also some annoyance with referrer spam. We tried some “solutions” found on the web – btw htaccess-manipulaton does not prevent from ghost referrers -, wasted some time manually creating filters in GA and finallly built our automated solution: http://www.referrer-spam.help …
We hope you’ll like it.
Best regards
And it appears ghost referrers have become the dominant player. We’ve updated the advice in the site. Thanks for all the help you’re providing!
Thank you for all your help with this!
You bet. We’ve updated the advice significantly based on the new ghost referral methods these jerks are using.
Great piece of help here, thank you! Now to patiently wait for the change of bounce rate 😀
I’ve updated the advice to provide a segment for Google Analytics. That way you can see the impact immediately.
It’s obnoxious upstream / downstream spam issues: The spammers spam it and then offer a remedy – that’s my guess.
Have you checked IP blocks or anything to see if there’s a range to find them?
Other ideas I’m trying to see if others have tried:
1) I’d say reset the cookie to have a longer session time count as a visit but the bots will keep pinging the site. These things need to be treated as DDoS attacks because of the way they drain physical resources
2) Make a new profile and put the new code in Google Tag Manager so the code isn’t as easy to skim. Also, making a new account and making like 4 profiles so the last number doesn’t end in -1 is another consideration. But, I’m guessing at this point the spammers are just auto-generating the UA numbers or ignoring UA numbers all together & using the campaign url builder tool
Hi, great guide, I’ve build a free tool that accesses analytics and builds an htaccess file for your site, its free http://refererspamtool.boyddigital.co.uk/ give it a go
Colin, this is a fantastic tool! I’m going to add it into the post!
Great stuff, Douglas.
Thanks Don! Hope all is well.
Really useful…. this type of spam traffic is the number one reason for messed up reports in analytics, which really doesnt help show clients how the site is performing.
thank you my website is full of spam and adsense banned me
Spam is becoming a huge issue nowadays. However, this post isn’t about your site or people actually spamming your site. They’re faking out Google Analytics. It shouldn’t impact your Adsense at all, but will mess up your Google Analytics.
I really fed up with this spam. I hope it’ll help me.
I am as well. I can’t believe that Google hasn’t come up with a solution for this.
Great piece, had some trouble with this in the past and most people seem to have no idea that it’s going even going on!
Thanks and I agree… I actually didn’t know what was going on for a long time, either!
Thanks for your article Douglas. Great read. I absolutely hate spam, it has caused so many problems for my websites in the past, sometimes caused my wordpress sites to crash when i had a older version of wordpress.
Definitely going to share this article on my site.
Im currently starting a wordpress blog for marketers.
Hi Douglas .. i have one question. I get a few visits from com.google.android.googlequicksearchbox / .com
Does that include spam? thanks for your answer
Hi Fauzy, I believe that’s a legitimate referrer from the Google Android mobile app.
Why does ghost referral happen, what do these spammers get out of it?
Hi Sheena,
It’s honestly really frustrating. The only benefit is that less-sophisticated analytics users will seek out the referrer and may buy their products or services. It’s a terribly cheap and ridiculous means of trying to trick less knowledgeable site owners.
Doug