Ghost Referral Spam in Google Analytics: How to Fix It

I have to admit I don’t like spam — not with breakfast, not in my Jello, and certainly not in my Google Analytics reports. Google has provided the interwebs with a really complex and useful tool for analyzing website traffic, and it’s totally free. But therein lies the problem. Anyone can sign up for Google Analytics and begin sending their data over for analysis. And just as easily anyone can send fake data to Google.

This is called “Ghost Referral Spam,” and it’s trending in a terrible way. You may recognize some of the top offenders — 4webmasters.org, darodar.com, and best-seo-offer.com — their names clog your reports and push down the real referrers and valuable leads. Why would someone add fake hits to your site? Are they just mean? No, there’s something devious going on here too. The intent is to get you to visit their site, which is often redirected to a store (earning the spammer click-through credit), or worse — they may be leading you into a malware trap. If you see a fishy-looking referrer in your Analytics reports, do a web search before visiting the site.

How Does This Work Anyway?

Assuming you have Google Analytics set up, when a real visitor loads a page on your site, a request is made for a tiny file from Google. This request carries with it your Google Analytics ID and the tracking information from the visitor (e.g.: source, medium, referral). Ghost Referrals exploit this open transactional method by faking a request to Google. There is no actual visit to your site — instead a malicious robot sends a random Google Analytics ID (potentially yours) along with their site url as the referrer.

So those hits from ‘4webmasters.org’ and the like are never actually visiting your site. This means no website filters or code added to .htaccess can block them. The only way to remove this false data is through Google Analytics, using filters or segments. And it turns out you probably need both, at least for now.

Filtering and Segmenting Spam

The latest trick to remove Ghost Referral Spam is to exclude data where the hostname isn’t correct. Since the spammers are randomly sending IDs and data, they don’t actually know whose ID they are using. Often the hostname — which should be your domain name — is not set or uses another random website name. This post has a guide for setting up your filter, and also has a link to an advanced segment you can import into your views.

This excellent segment is easy to install, updated with info about all the latest bad guys, and it works like a charm. Segments are great because the don’t permanently alter your data. They’re just a way of viewing part of your data. You can even compare the full data view (below, in blue) with the segment (orange).

Google Analytics Ghost Referral Spam Removed

Notice how the blue spikes (Ghost Referral Spam) are clipped off. Turns out this spam accounted for over 25% of the website traffic in these three months! Segments are a little annoying because you need to remember to apply them every time you view your reports (unless you create a custom report or dashboard where segments can be included).

The best thing to do is create a new filtered view of your data that will restrict by hostname. Make this filter as soon as you can, and update it regularly with the latest spammers. However, keep in mind that all the spam hits collected before you created the filter will remain in your data. (This is why you’ll want to keep that segment around — use it whenever you need to look at your historical data.)

So We’re Safe Now?

Unfortunately, there’s one major problem with filtering or segmenting by incorrect hostnames — it won’t take long for spammers to figure out how to spoof the real hostname as well. What’s required here is a global solution from Google that will authenticate analytics requests to confirm real hostnames. Google has mentioned that they are working on the problem, but there is no mention of when this might be fixed.

In the meantime, set up your filters, apply your segments, and under no circumstances should you open up any spam.

Work With Us

We've been building websites for over twenty years, and have learned a thing or two about how to make web projects go smoothly.

What Our Clients Say

Watermelon Web Works, LLC place picture
4.7
Based on 19 reviews
powered by Google
OMS Anita profile picture
OMS Anita
22:20 29 Nov 24
Watermelon Web Works has been incredible to work with. They are patient, understanding, and quick to answer any questions (or emergencies) you might have. After switching over to them to help re-vamp our online retail store, we hired them to build our wholesale website as well. I can't recommend them enough - Thank you team!
Garrett Lister profile picture
Garrett Lister
19:55 10 Jul 24
Jared and the watermelon team were great - they quickly interpreted our website needs and designed a wonderful site. The project management site worked great to keep track of project.
N B profile picture
N B
21:23 14 Nov 23
My previous web developer who I was very happy with retired and I was pretty sad about it because it seems now days it is hard to hire a web developer close by with a good set of skills who is interested in helping small business at reasonable prices. Then I found Watermelon and I have been very happy. They are responsive, are able to solve problems, and work at reasonable prices.
Dark Star Magick profile picture
Dark Star Magick
18:05 03 May 23
We hired Watermelon to help us with our website. They were very thorough and took the time to explain in layman's terms what they were doing and how we could improve SEO and site functionality. We will definitely be back for future website needs!
Astoria Column profile picture
Astoria Column
18:42 24 Apr 23
Great work and amazing service! We're a non-profit, and our priorities are always focused on maintaining the Astoria Column. We had a website built by someone else a few years ago, but without regular updating and maintenance, sections of our site were no longer functional. Joanna and the rest of the team came in and had everything working within a week and it's been smooth sailing since then!
Ben Harris profile picture
Ben Harris
19:25 26 Aug 19
Watermelon has been a fantastic web development partner. Through every phase of our project they have always been 100% responsive to our requests and have always provided highly knowledgeable, creative, prompt, and personable team members to work with. As a financial institution we’re always concerned about the security and maintenance or our website and Watermelon has always provided the appropriate resources in order to meet and/or exceed our compliance and security requirements. We would surely refer them to any business associates looking for a qualified WordPress web designer in the future. – Denali Federal Credit Union
Mohr IP Law Attorneys profile picture
Mohr IP Law Attorneys
00:33 11 Apr 19
Watermelon Web Works did a great job creating a custom shopping cart page for our firm. Gavynn in particular was especially helpful and responsive. We appreciated the upfront costs and the technical competency of Watermelon Web Works and would not hesitate to work with the people there again.
Kim Markle profile picture
Kim Markle
23:36 08 Feb 19
Our company has been working with the Watermelon team for more than 10 years to help build and grow our website and customer portal. They are not only extremely talented and responsive, but are continuously looking for ways for us to enhance our current website. They are consistent, provide excellent customer service and really know what they are doing. Highly recommend!
Rick Brodner profile picture
Rick Brodner
23:23 12 May 17
I cannot say enough good things about Watermelon. They are terrific communicators, highly competent coders, and really, really nice people. They were instrumental in helping us to assemble a very usable, easily maintainable website for our organization. They' have demonstrated great flexibility in accommodating our evolving needs. They have been highly responsive to any technical issues, typically resolving them in less than 4 hours. Watermelon Web Works will make your organization better, and your CFO/Treasurer will be happy when they see the bill - what more can you ask for?
CLOSE