How to Block Referral Spam in Google Analytics

Referral Spam Google

Got referral spam in your Google Analytics? If you’re like most businesses or bloggers – big or small – odds are you have a spam problem. It’s okay, we can deal with why you have spam problems in another post, but let’s start with finding out how bad the issue is first.

Log into your Google Analytics account and click on Acquisition > All Traffic > Referrals. Now adjust the dates to look at the past 3 months. If you see a bunch of unrecognizable sources, such as trafficmonetize.org, floating-share-buttons.com, or traffic2money.com – you’ve got spam.

Referral spam can be a pain when it comes to getting accurate data from your analytics, and it can also be a pain when it comes to filtering out all of that bad data. After helping numerous clients (and friends) learn how to get more accurate data in their analytics campaigns, here are a few ways that you too can get better data with your monthly reporting.

Important note first: I always have 2 views available when doing advanced segments and customization in Google Analytics. The first view is the normal, unfiltered data – this is your safeguard, just in case you set a filter up wrong. The second view is where I start blocking out things like referral spam and particular IP addresses.

Switch on Bot Exclude in the Admin Panel of Google Analytics

This one is easy – albeit, not a trustworthy source for filtering referral spam. All you have to do is login to the Admin portion of Google Analytics under the Account > Property > View you want better control over your referral spam. Under View click on View Settings. Scroll down and click on Exclude all hits from known bots and spiders. Click Save and you’re done.

Google Analytics Referral Spam Filters

Because the step above isn’t the most reliable step in getting rid of referral spam, our next step is setting up a custom filter. From the point you are in the above step, simply click on Filters in the left navigation, and then follow these steps:

  1. Click on + New Filter.
  2. Type in a filter name, like Block Referral Spam 1.
  3. Choose Custom, Exclude, and Request URI for the Filter Field.
  4. The Filter Pattern will include the spam URLs you want to block, each separated by a \.| at the end (the last one doesn’t have the pipe at the end). For example, one of my spam filter patterns is (The filter pattern has a limit of 15):4webmasters\.|7makemoneyonline\.|buttons-for-website\.|buy-cheap-online\.|darodar\.|event-tracking\.|floating-share-buttons\.|free-share-buttons\.|get-free-traffic-now\.|guardlink\.|semalt\.|social-buttons\.|trafficmonetize\.|trafficmonetizer\.
  5. Lastly, click Save and this filter will run behind the scenes.

Google Analytics Custom Segments

Custom segments can allow you to see a variety of different options when it comes to filtering and segmenting your data. One of my favorites, of course, is getting rid of all of the spam that the admin panel doesn’t do from the step above.

The step above is important, but you’ll find that some of the referrers still get through and skew your data. Turning on your custom segments as a final step will help you get a better picture on month-to-month stats. There are two things you can do at this point: 1) Follow the step-by-step instructions below to set-up your own custom segments or 2) Use the links below and add them to your account (once added, you can customize them to fit your referral spam:

Here’s How to Set-Up Custom Segments in Google Analytics

  1. Take a look at your top referrals over the past quarter. Depending on how much traffic you get on a monthly basis from these referrals, you may be able to filter out all of the spam. I pull them from Google Analytics and put in a Google Sheet so that I can compare each quarter how things may have changed – more referral spam, less referral spam, etc. Know that a lot of URLs will look very, very similar, but even the addition of a letter to the URL means it’s a different URL and will have to be filtered out. The easiest and quickest way to known if there are duplicate URLs in the list is to do Conditional Formatting in Excel to find the duplicates (I realize I switched over to Excel here; I prefer Excel for the most part, because of formatting things like this. Google Sheets doesn’t make it as easy.). Scroll to the bottom of this list to see the top referral spam that are in the custom segments I linked to above.
  2. Now, log into Google Analytics and click on Admin > Segments. Click on New Segment. Name the segment whatever you’d like. I like to start with a * so that it’s always at the top of my list – let’s call this one *EXCLUDE Spam.
  3. Click on Conditions under Advanced. Your first condition filter needs to be set to: Sessions + Exclude. Then, change the filters below to: Source + contains.
  4. Enter in the first of the spam URLs that you pulled from step 1 – but copy and paste the URL WITHOUT the www or http/https. This part is important because some sites think they’re sneaky and will update the part before the URL so that it still gets into your data, e.g. free-floating-buttons.com, site2.free-floating-buttons.com, site4.free-floating-buttons.com, and site5.free-floating-buttons.com can all be filtered out by just entering free-floating-buttons.com. Make sure to ONLY put in URLs that you know are spam. If you enter in a URL that isn’t spam, guess what, it’s going to be filtered out.
  5. To add another condition, just click the And You can add a total of 20 conditions (or 20 URLs per custom segment.
  6. When you’re done adding your top 20 referral spam, click Save.
  7. Continue 1-6 until you have all of your top referral spam blocked through custom segments. It’s important to note that having too many custom segments in place can also cause issues with data. I usually don’t have more than 2 custom segments turned on at once, and will turn them off when I don’t need them, i.e. referral spam don’t mess with my organic traffic data, so I can turn the custom segments off.

To View Data with Referral Spam Custom Segments

  1. Switch over to Reporting (top navigation by Admin).
  2. Click on + Add Segment towards the top right – usually above the graphs in Google Analytics.
  3. Uncheck the segment that is currently selected, and then select the new spam filters you created. The data that appears now should reflect more accurate data. If you see nothing but 0s across the board, the filter wasn’t set-up correctly. Go back and make sure you chose Source as a filter point – that’s where most people go wrong with setting up filters.

You’ll need to export the data and run the numbers through Excel to get a new total, because the multiple segments don’t work together, but separately. However, for a quick look at things, your first custom segment will likely filter the majority of the referral spam – mine filtered out 64% of total referrals (that’s a lot of spam, right!).

Top Referral Spam

For the custom segments I created and shared above, there were are the referral spam being excluded:

•    100dollars-seo.com
•    4webmasters.org
•    best-seo-offer.com
•    best-seo-software.xyz
•    blipstar.com
•    buttons-for-website.com
•    buttons-for-your-website.com
•    chinese-amezon.com
•    dailyrank.net
•    e-buyeasy.com
•    event-tracking.com
•    floating-share-buttons.com
•    free-floating-buttons.com
•    free-social-buttons.com
•    get-free-social-traffic.com
•    Get-Free-Traffic-Now.com
•    hongfanji.com
•    qualitymarketzone.com
•    semaltmedia.com
•    seo-platform.com
•    sitevaluation.org
•    success-seo.com
•    traffic2money.com
•    trafficmonetize.org
•    trafficmonetizer.org
•    videos-for-your-business.com
•    webmonetizer.net

Closing Notes, Ghost Referrals, and Hostnames – Oh, My!

Lastly, there’s also a way to filter out ghost referrals by hostnames, but this can be tricky if you don’t know what you’re doing, i.e. you could block all of your traffic if you don’t set things up right.  However, it’s important to note that this is an additional step in fighting spam

Although you may not need to, I do a quick scan for new referral spam each month. If a new referral spammer is sending a lot of traffic and skewing the data, they get added to the filters above.

Want help with setting this up?

Let Us Help

About Kasy Allen

Kasy brings years of experience in search engine optimization (SEO), content strategy, Internet marketing, and overall web-geekery to the table. She enjoys writing on the web and improving user experience across the Annapurna site, as well as with our clients. When Kasy is out of the office, she can often be found volunteering her time to help non-profit organizations build a better online presence and exploring the great outdoors with her family.

Leave a Reply

Ready to discuss your project? Request a Quote