Referrer SPAM: 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’s a ton of other offers there. Guess what? Those people never actually referred traffic to your site.


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

  1. Sign in to your Google Analytics account.
  2. Open the View that includes the reports you want to use.
  3. Click the Reporting tab, then open the report you want.
  4. At the top of your report, click + Add Segment
  5. Name the segment All Traffic (No Spam)
  6. In your conditions, be sure to state exclude with source matches regex.
  1. There’s an updated list of referrer spammers on Github that Piwik users are using and it’s pretty good. Here’s my list (you can copy and paste it in Google Analytics):

  1. 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!

Download a Sponsored Marketing Whitepaper:
Social Influence - Using the Power of Social Media To Attract A Crowd of Loyal Followers

Social Influence - Using the Power of Social Media To Attract A Crowd of Loyal Followers

Social media is a world of its own, it has redefined the meaning of interaction and reality. Download Now


  1. 1
  2. 3
  3. 5
  4. 7
  5. 9

    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

  6. 10