Back to Blog

How to Filter Spam Traffic In Google Analytics

Bots are a problem for website traffic. The good news is that it’s easy to identify spam traffic and apply filters to your Google Analytics.

how to filter spam traffic in google analytics
Categories for this post:

The purpose of Google Analytics is to understand user behavior and measure the performance of a website. It’s a powerful tool used by millions around the globe. It’s also riddled with referral spam traffic. Here we learn how to filter referral spam for your Google Analytics account, and block it from showing up again. 

TLDR: To ensure the data collected by Google Analytics is valid, create a filter to exclude traffic referred from selected domains. Go to the admin section of your Google Analytics account.

  1. Under the View column, click the “Filters” button.
  2. Click the red button “+Add Filter”
  3. Then follow the specific configuration for each of your filters.

What is Referral Spam Traffic and Does it Hurt My Website

Referral spam is created by bots (software applications that run automated tasks online) designed to send false HTTP requests to your website. This non-human traffic is known as bot traffic, and it accounts for nearly 40%  of all website activity. 

Referral spam is not directly harmful to your website, but it does artificially inflate your Google Analytics data. Skewed Google Analytics data is useless. Without data integrity, you can’t make accurate decisions regarding your website or your marketing strategy. 

How to Identify Spam Traffic in Google Analytics

Bots are a nuisance, but they’ve been spamming websites since the early days of dialup. The good news is that it’s easy to identify spammers and apply filters to your Google Analytics report so you only see legitimate traffic. 

Spam traffic typically shows up as a referral, but it can appear in any part of your reports even in unsuspecting places like language or page title. Oftentimes, spammers try to fool users with misleading URLs, emojis and unusual characters. Other indicators are:

  • A bounce rate of either 0 or 100%
  • A session time of 0 seconds 
  • A hostname referral that’s not set

There are all kinds of bots. Some are good. Many are bad. Regardless of how the bot manifests in your report, its traffic is useless. Regardless of the spam you find, you should:

  • Never visit the suspicious URL – The link may contain malicious script or redirect you to a site that promotes something you don’t want to buy. 
  • Never install scripts from unknown sites – If you already installed a script from an unknown site, you probably have malware. Scan your site and remove it immediately. 
  • Utilize filters to remove spam from your view – You need the necessary permissions to make changes in your Google Analytics account, but once you have admin access, you can create a new view to test new configurations like filters.

How to Stop Google Analytics Referral Spam Traffic

Unless you do something to stop them, bots will send referral spam to your website until the end of time. Fortunately, there are five ways to stop Google Analytics referral spam from mucking up your data. 

Exclude Known Bots and Spider

Google will do the bulk of the referral spam filtering work for you automatically. All you need to do is navigate to your test view “View Settings” and select the “Exclude all hits from known bots and spiders” button. This step will remove up to 80% of all bot traffic.

Filter Spam Bots 

Keep an unfiltered view to ensure your filters are working, and so you have data to compare with your filtered results. The best way to do this is to set up an unfiltered view in Google Analytics. 

You can set up a number of different spam filters in Google Analytics, but these will block the three most common types of spam:

  • Ghost Spam – Ghost spam is fake traffic inserted into your Google Analytics account by hackers to get you to visit their websites. You can remove ghost spam with a custom filter that tells Google Analytics which hostnames belong in your account and which do not.
  • Fake Language Spam – Language spam is used by spammers to promote their own sites or products. They manipulate the language used by real sites like thenextweb, lifehacker, and reddit. But you can remove it by creating a custom filter. Set field equal to “language settings” then paste \s[^\s]*\s|.{15,}|\.| into the filter pattern box.

Edit Your Domain’s .htaccess File

If your hosting uses cPanel, one of the most effective ways to block spam referral traffic is by editing your .htaccess file to not only block referral spam domains from your website, but also remove them from your server. 

For example, you could exclude Semalt, free-traffic.xyz, and buttons-for-website.com by adding the following command to your website’s .htaccess file:

## SITE REFERRAL BLOCK

RewriteCond %{HTTP_REFERER} semalt\.xyz [NC,OR]

RewriteCond %{HTTP_REFERER} free-traffic\.xyz [NC,OR]

RewriteCond %{HTTP_REFERER} buttons-for-website\.com [NC,OR]

RewriteRule .* – [F]

Remember, all it takes is one character in the wrong place to take your whole website offline. So be careful when editing anything related to .htaccess

Use a Third-Party Tool 

If you use WordPress, you can use a Google Analytics WordPress referral spam plugin to get rid of bot traffic. Here are just a few of your options:

Hire VisualFizz

If all of this sounds highly technical and confusing, it’s because it is. It’s also necessary to protect the data integrity of your website. Fortunately, you don’t have to create any of these filters or mess around with your precious .htaccess. All you need to do to protect your website data from spam is hire the experts at VisualFizz.

Contact us today to schedule a consultation. We’ll chat; learn about your business, then jump into your Google Analytics account to filter out all of the spam. With fresh, accurate data in hand, we can immediately get to work on a digital marketing strategy to increase conversions, and promote your business.

Upgrade Your Marketing

Chat with a team that understands well-developed full-service marketing.

Contact Us

Popular Articles

The Ultimate Guide to Branding a City, Smart City, or Municipality
People and products are brands. However, this concept strongly applies to cities as well. Since the...
Branding a City – Melbourne, Australia
Branding a City – Melbourne, Australia Branding a city is far different from branding a...
Brand Fails in 2021
Brand Fails of 2021 and How To Avoid Bad Branding
A brand fail is, at worst, a mild annoyance to the average consumer. Most consumers...

Marketing Articles

CyberStockroom Manufacturing Main
How To Improve Inventory Mapping and Management in Manufacturing
How Inventory Mapping Enhances Inventory Management in the Manufacturing Industry Managing inventory in the manufacturing...
productivity tips b2b visualfizz blog
7 Way to Unlock Productivity on B2B Teams
Unlocking Productivity: 7 Techniques Every Company Needs What you’ll find included in thie guide:  Measure...
b2b vs b2c marketing
B2C vs B2B Marketing: 5 Key Differences Every Marketer Needs to Know 
B2C vs B2B Marketing: 5 Key Differences Every Marketer Needs to Know  Both business-to-consumer (B2C)...

Let’s Work Together

"*" indicates required fields

Interested in learning more about our services?*
Hidden
Hidden

Fueling Growth and Nurturing Client Relationships Since 2016

Contact the leadership team. We’ll discuss:

  • Understanding Your Business
  • Chatting About Marketing Goals
  • Brand Strategy and Recommendations
  • Learning More About VisualFizz
  • Setting Expectations and Planning
  • Budget and Timeline

If we’re a fit, we’ll tailor our marketing strategy and brand-building process to your unique goals and needs. Every project plan is developed custom for you. Straightforward results, every time.

"It's been a partnership marked by trust, reliability, and continuous improvement"
"From the time we first met with VisualFizz, we knew instantly that they were going to be the Chicago Marketing Agency we would work with for the long run."