Analytics expert

SEO passionate

User Experience obssessed

Follow me on
Category | Google Analytics
Difficulty |

How to Efficiently Deal with Any Type of Spam in Google Analytics

If you want an accurate Google Analytics, creating filters to prevent spam is one of the first things you should do. This guide:

  • will help you stop and remove Google Analytics referral spam and any other type of junk (keyword, page, etc.)
  • will work independently of the platform you use (WordPress, Joomla, Shopify, Wix, Squarespace...)
  • is regularly updated to deal with new spam tactics (so you can keep it as a reference)
This guide will also help stop it and clean bot traffic from the service provider "google llc" and "google inc"

  • Soruce:, (direct), Adwords or reachlocal
  • Search term: googletestad
Most recent spam and bots detected (Last Checked: February 23, 2018)
  • Covered by the hostname filter:,,,, and 30+ similar combinations, and fake events (event category: new, event action: phase, event label: sorry)
  • Covered by the crawler filters:, uptime-as/us/, / referral
  • Covered by the bot/ISP filter: fake amazon keywords from "bing" and network domain
  • Covered by the bot/ISP org filter: hubspot and google llc bots
List of latest spam (expand)
Recent Referrer SPAM List (Full List at the bottom of the post) google llc (Service Provicer)
amazon keyword from bing organic search and ISP / referral amazon organic keyword / referral
Want notifications about important updates, new threats and new ways of keeping your Analytics data accurate?

Why does the spam and bots keep showing in my Analytics!?

The main frustration I see among Google Analytics users is that they apply all kind of solutions and the spam keeps going through. This is because commonly shared solutions won't adapt to the constant changes of names and methods the spammers use.

To avoid this back and forth, I will show you how to efficiently deal with any type of spam in your Analytics, so you don't waste your time with partial solutions, plus I will also show you how to do it safely so you don't risk your real user data.

Do have time to deal with this? I can help!

Myths about the Spam in Analytics

Let's begin with what you shouldn't. If you made any of the mistakes below, undo the changes if possible.

How does Ghost Spam attacks Google Analtyics?
Keep your data accurate.👊The ultimate guide to cleaning #GoogleAnalytics spam & other junk trafficClick To Tweet

The Right Way of Dealing with Spam in Analytics

The solutions I'm going to show you have been proven to work for over two years regardless of the forms used by spammers (referral, keyword, page, language, etc.)

Don't believe me? see some examples of users that followed this guide

The following screenshot shows some examples of analytics users that followed this guide:

  • The data in blue: Segment of data showing only spam traffic.
  • The Orange line: The moment when the filters from this guide were applied to that Analytics property.
Permanent filters for spam applied graphs

So I will show you how to get these results for your Analytics.

How to Remove All Referral, Page and Keyword Spam in Your #GooogleAnalyticsClick To Tweet

Here is what you will accomplish by the time you've implemented the instructions in this guide:

  1. Protect your data by following a few best practices for your views.
  2. Stop the spam and other junk traffic with efficient filters that don't need to be constantly updated.
  3. Clean your historical data with an advanced segment.

You can use the Quick Navigation   on the right side of your screen to quickly jump between sections.

STEP 1 Protecting your Data from Misconfigurations

This step is not strictly required to keep clean your analytics, but it is still important to protect it from possible misconfigurations because once data is recorded/altered in Analytics there is no way back.

Every Google Analytics account should have at least the following views:

  • Master - View where you will apply filters. Used for analysis
  • Unfiltered - Your backup view, which, shouldn't have any filter or any setting that alters the incoming data.
  • Test (Optional) - if you want to be extra cautious you can create a test view that you can use to try the filters.

If you are already following these best practices, go to the next step.

If you haven't and need help, here you can find the instructions on how to create an unfiltered and a test view

STEP 2 Stopping Google Analytics Spam

Once your views are correctly configured, the next step is blocking all of that dirty traffic that inflates your reports and don't let you see the real performance of your site. 

The filters for Google Analytics spam you will need:

  1. Filter Google Analytics ghost spam (for referral, page, keyword spam)
  2. Filter for crawler referral spam
  3. Filter for Fake Languages and Other Less Common Spam
  4. Extra: Filter for Internal traffic
  5. Extra: Enable the built-in feature Bot Filtering (to exclude known bots)

Don't have the time or need help implementing these solutions?

General notes about filters.

  • While most of the time filters start working in minutes, officially it may take up to 24 hours before the filter effects become visible in your data, so be patient.
  • You will apply the filters either in the master view, the view(s) to be used for analysis, or the test view if you want to try them first.

a. Create a Valid Hostname Filter to Stop Ghost Spam 

This is the single most effective solution against the spam. This filter will permanently stop all traffic from common spammers like !.comsharebutton, earn-from-articles sites, organic spam, and most of the language junk.

The difference between this solution and other commonly shared is that this filter is based on something that you control, your hostnames.

What is a hostname? expand

There is one thing I want to make clear because it sometimes causes a bit of confusion. Some people mistake the hostname with the source.

The Source is where your visit comes from and there can be any number of them, for example, Facebook, Google, Twitter, Youtube, links from other sites to your site, etc.

The hostname, on the other hand, is the site where the visitor arrives. Your main hostname will be your domain and, and depending on the configuration of your site, there may be others.

Source vs Hostname Google Analytics

So as long as you add all of them you don't have to worry, you won't exclude any real traffic.

The main characteristic of ghost spam is that it never visits your site. Instead, it uses the measurement protocol to reach your GA directly. For that reason, this type of spam always leave a fake hostname or leaves an "undefined" hostname which will appear as (not set) in your reports.

If we use this to create a filter that will only let pass traffic with valid hostnames, all ghost traffic will be automatically excluded. This solution is much more efficient than the one commonly used, which is to create a filter with the name of spam. Plus this technique will work for any type referral, keyword, page, language, etc.

There are 3 things you need to do to build this filters
1. Find and make a list of your Hostnames: At least you should have one main hostname which will be your domain and depending on your site configuration you may find others. To see a list of all your active hostnames you should go to the Network report in your Analytics and select the blue text "Hostnames" at the top of the report. Make a list of all the valid ones.Not sure which are your valid hostnames? Expand instructions

How to find your hostname report

The most important part of this method is getting a list of all your valid hostnames to avoid excluding any legitimate traffic. For that, you will need to find your network report then select hostname at the top of the report.

  1. On the reporting section, select a wide time frame on the calendar, go to the Audience reports in the sidebar.
  2. Expand Technology and select Network
  3. Make sure you select Hostname at the top of the report (by default Service Provider is selected), you will see a report with all your hostnames (real and fake).How to find the hostname report - Google Analytics
  4. Make a list of all relevant host names you find. At least you should see one that will be your primary domain. The rest depends on the configuration of your site and all the services that have added tracking code (UA-000000-1). Here are some examples:
    Your main domain: Subdomains:
    Translate services: Bing translate Shopping Carts: Shopify
    CDNs: CloudFlare Video Services: Youtube
    Cache Services: Google cache IP's:
    Payment Services: Paypal

    An invalid hostname is essentially any other that you do not know or control. For example:

    - Hostnames with URLs pointing to the spammer website.
    - Known sites that may no look spammy but you don't control like, or  (spammers use them to mislead people)
    - The most common hostname for spam (not set), this happens when the spammer doesn't even bother to set a fake hostname.

    The following screenshot is an example of a hostname report:

    Green: Valid  Red: Spam
    Google Analytics Hostname Report
    These are just examples of hostnames, don't add hostnames that are not on your list

    From the report above we get the following valid hostnames. Remember we are looking for real valid hostnames to include, not to exclude.
2. Build your Hostname Expression: Once you have the list of all your hostnames, you have to create a regular expression (REGEX) that contains all of them.Need instructions to build your hostname expression? Expand instructions

How to build your valid hostname filter expression

Once you gather all of your valid hostnames, you should create Regular Expression (REGEX) that matches all of them. Here are some tips to help you build your expression:

  • To separate each hostname, you should use a bar or pipe character |, this works as OR, if you can´t find it, hold Alt + 124(Numeric pad)
  • The dot . and the hyphen - are considered special characters in REGEX so you should add a backslash \ before them.
  • Try to find a good way to match as many hostnames as you can, for example, if you want to match,,, you don't need to add all of them to the expression entering carloseo, will be enough to match all of them (just avoid using common names).
  • Don't leave any spaces.
  • The REGEX has a limit of 255 characters if your expression exceeds this limit try to optimize it to keep everything under one expression because you can only have 1 Include hostname filter
  • Don't add a pipe/bar |, at the beginning or the end of the expression.
  • More about Regular Expressions

Following the recommendations above and using our list of Valid hostnames:

List of hostnames found in the report

We can build the expression that will match all of them:


It is important that you add all your relevant hostnames, or you will lose valid data. If you want to be extra sure that you are not missing any, you can test your expression using a quick segment or by testing your filter for a few days in a test view.

Do you need help configuring the filters? I can help you

3. Create the valid hostname filter: Once you are sure the expression is correct, create an include hostname filter to get rid of all that nasty ghost spam once and for all.

How to Create a Valid Hostname Filter to Stop Ghost Spam

To block all ghost spam in Google Analytics, you need to create an include hostname filter:

  1. Go to the Admin tab, and select the view where you want to apply the filter. If you follow the naming above, this will be the Master view or Test view.
  2. Select Filters under the View column, and select + Add Filter
    Add filter button Google Anlaytics
  3. Enter as a name for the filter Include Valid Hostnames.
  4. Configure the filter as follows:
    • Filter Type Custom > Include
    • Filter Field Hostname
  5. In the Filter Pattern box copy the hostname expression that you built before.
  6. Click on Verify this filter, you will get a quick glance of how the filter will work. You should only see spam or irrelevant hostnames on the left side of the preview table. 

    If you get the message below, is probably because of the limited data used by this feature

    This filter would not have changed your data. Either the filter configuration is incorrect, or the set of sampled data is too small

    Try verifying it with a quick segment (if you haven't done it yet).

  7. After making sure your filter is ok, Save the filter.

IMPORTANT: This filter doesn't require updates for new ghost spam, but it's essential to update the expression whenever you add the tracking ID to new service or domain.

👊The ultimate guide to cleaning spam & other junk traffic in #GoogleAnalyticsClick To Tweet

b. Creating a Source Filter to Stop Crawler Referral Spam

Crawler spam uses a valid hostname so it is a bit harder to detect. To block it you'll need a filter with an expression that matches the source of all known crawler spam.

To save you some time, I've created a set of optimized regular expressions (REGEX) with all the relevant crawler spam detected over the last 3 years, you'll find them below in the instructions.

How to Stop Crawler Referrer Spam in Google Analytics

To stop referral spam in Google Analytics you will need to create an exclude filter using the campaign source:

  1. Go to the Admin tab.
  2. On the last column "VIEW", select Filters  and then click + Add Filter  Add filter button Google Anlaytics
  3. Enter as a name for the filter "Exclude Crawler Spam"
  4. Configure the filter as follows:
    • Filter Type select Custom > Exclude
    • Filter Field select Campaign Source (don't use referral field or it won't work) How to create a filter for crawler referral spam in Google Analytics
  5. Filter Pattern > Paste the following crawler referrer spam expression.

    Create 1 filter for each expression

    Crawler Expression 1


    Crawler Expression 2


    Crawler Expression 3


    Crawler Expression 4


    Crawler Expression 5


    Get an email with the updated expressions whenever I detect new crawlers.

  6. After everything is set Save.

Note: You may find other referrals that may not be spam, but neither relevant for you. For example, mobile test sites or cache sites. You can create a similar filter with the same configuration and add all the irrelevant referrals there to keep your data pristine and reliable.

c. Creating Filters for Fake Languages, ISP bots and Other Types of Spam

With the 2 solutions above we've covered a great part of the spam but there are other sneaky types that will pass those filters.

To create these filters follow the first steps of the crawler spam filter and just change the fields indicated below.

Network/ ISP Domain Filter

You may be surprised to find amazon keywords in your organic search reports. This is just the latest form of spam, and it comes as Bing organic traffic with the keyword amazon and the network domain

    • In Filter Name set Exclude ISP domain spam
    • In Filter field select ISP domain
    • In Filter pattern box enter the following expression as it is:

ISP Organization Filter

Not all irrelevant traffic comes from spammers, some companies uses bots to crawl sites for information (indexing, analytics, etc.), those bots don't have bad intentions but they still pollute your data.

    • In Filter Name set Exclude ISP provider spam
    • In Filter field select ISP organization
    • In Filter pattern box enter the following expression as it is:
      hubspot|^google llc$|^google inc\.$

Language Spam Filter

From time to time you may see weird languages showing in your analytics. I prepared the following expression to prevent any language that doesn't have a proper format like en-us, en-uk, es, etc.

I also added at the end what seems to be language left by bots represented by the letter "c"

    • In Filter field to Language Settings
    • In Filter pattern box enter the following expression as it is:
      spam and language c google analytics

Fake Page Title Filter

Sometimes spammers use valid referrals to spam (ie, twitter) in those cases this filter will help prevent them without filtering real data.

    • In Filter field to Page title
    • In Filter pattern box copy the following expression as it is:

d. Extra: Enabling "Exclude all hits from known bots and spiders"

There are many other crawlers around that are not spam but neither useful for your reports. For example, the ones crawling your site for indexing. This bots will leave a record in your reports if not excluded.

In this case, is a bit easier because Google Analytics has a built-in feature to exclude this traffic.

How to enable bot filtering

Repeat the following steps for all your views

  1. Again in the Admin Tab, select one of your views under the VIEW column in the admin section.
  2. Click View Settings
    Bot Filtering in Google Analytics
  3. Near the bottom check the box Exclude all hits from known bots and spiders (Bot Filtering)
    Exclude all hits from known bots and spiders
  4. Save and repeat the process with all your Views

You can see the more details about Google Analytics Bots and Spider Filtering here.

e. Extra: Excluding Internal Traffic

Google analytics spam filters are important, but there is another source of junk traffic that is often overlooked, the internal traffic.

If you don't apply filters for the traffic generated by you or other people of your team, this data will get mixed up with your real visits data, and a difference with the spam, this is much harder to identify later.

To create this filter, you will need the public IP of the network/wifi you want to exclude. You can find it here. You will see something like this  12.345.678.90 or the longer version IPv6.

If you need help building this filter and other methods you will find full instructions for internal traffic filters in this post.

STEP Removing Spam from your Google Analytics Historical Data

The spam that is already stored in your Analytics (or any data for that matter) can't be permanently deleted. That is why it is important to create the filters to stop receiving junk traffic.

However, you can still clean your past data affected by spam using a combination of the valid hostname expression you built and all the expressions I built for you.

How to Clean up the Spam from your Google Analytics Historical Data

To eliminate referral spam and other junk from your Google Analytics historical data:

  1. Go to any Report in your Google Analytics.
  2. At the top of the graph, click on the box that says All Users. Next click the red button +NEW SEGMENT  New Segment GA
  3. In the segment window, almost to the bottom click Conditions  
  4. Configure the first condition:
    • Filter > SessionsInclude
    • Dropdown 1 > Hostname
    • Dropdown 2 > matches regex
    • Textbox > Paste the Hostname Expression that you previously build.
  5. Click +Add Filter at the bottom to add a new condition. How to remove spam from historical data in Google Analytics with a segment
  6. The second condition has 5 fields, (repeat for each field)
    • Dropdown 1 > select: 1 Source | 2 Language | 3 Page title | 4 Network domain | 5 Service Provider
    • Dropdown 2 > matches regex
    • Textbox > Paste the expression correspondent with the field type (see below)
    • Click OR on the right side to add another field and repeat with the next expression.
    1 Source
    2 Language
    3 Page Title
    4 Network Domain
    5 Service Provider
    hubspot|^google llc$|^google inc\.$

    Get notified whenever I detect new types of spam. You will receive the updated expression directly to your email.

  7. Enter 0. All Users - clean as a name for the segment and Save. (the 0 at the beggining of the name is to put the segment at the top of the list)

After saving the segment, you will be able to see spam-free reports, as long as the segment is selected. Eventually, the filters will do their work, and you won't need to use the segment anymore.

Security, SEO, Rankings and Other Common Concerns

Because the article was getting too long, I divided the theoretical from the practical part. If you have more questions or concerns, you can also check the FAQ I made about the spam in Google Analytics.

Things like:

  • Does the spam harm my SEO-Rankings? Short answer no
  • Is Google doing something to handle this threat?
  • How does it get in your reports?

These and many other answers and demonstrations.

Other ways of improving your Analytics

Cleaning up your analytics is an important part of getting reliable data. To ensure you get even better insights, I recommend you to follow these best practices.


Google Analytics is a powerful tool that will help you understand your traffic but it will take some work if you want to ensure you receive clean and trustworthy data. Otherwise, you might be pointed to the wrong direction.

You shouldn't handle each spammer individually it is time-consuming and inefficient. Instead, a few filters with the optimized expressions I shared with you will do all the work.

  • 1 Valid hostname filter for Ghost Spam
  • 4 Crawler referral spam filters with optimized expressions
  • And 3 more for the sneaky spammers (language and page title filter)

"Even on high volume websites were data spamming would be marginal, you still have to explain why there's such a discrepancy. As an analyst you can't dismiss it simply by saying "nah... we're not too sure what it is, but I heard about that spamming thing..."

-Stéphane Hamel

These solutions have been proven to work for over two years regardless of the tactics used by spammers as the following screenshot shows.

Do you have any Questions/Feedback?

I've tried to cover every important detail in this article, however, if there is any part of the guide where you got stuck, let me know in the comments section below and I'll try to clarify it for you.

I've also prepared an FAQ about Google Analytics Spam with all the answers to the most common concerns.

Do you need help implementing, configuring or protecting your Google Analytics?

If this article helped you, please consider sharing it or leaving a comment below on your experience. It may help other people! :)

✋👊How to Remove Referral, Keyword and Page Spam in Your #GooogleAnalyticsClick To Tweet

Complete Blacklist of Analytics Spam (Crawler and Ghost).

I will keep this list updated so you can keep filter google analytics spam as it shows. Keep it as a reference in case you find any suspicious traffic in your Analytics.

Deal with Crawler Referrer Spam

Last occurrences: / referral, / referral, / referral

Crawler Spam List
amazon keyword from bing organic search and ISP google llc and google inc (service provider) / referral / referral / referral / referral / referral / referral / referral / referral / referral / referral / referral / referral ḷ.com / referral / referral
oldfaithfultaxi / referral / referral / referral lifehacĸ referral / referral / referral / referral (editorial note: the owner of this site was not aware that his site was used as spam, he already reported the persons behind this, he also complained to PayPal and was refunded)

List of Ghost Spam

 LIST OF LATEST referral GHOTS SPAM referral / referral / referral page title / referral ḷ.com / referral / referral / referral search shell referral page title / referral
secret.ɢ / referral / referral / referral / referral / referral 
scanner-[name].top / referral compliance-***.top / referral with page tiltle
MULTIPLE combinations (30+) of fake keywords with at the end  
Check full historical list of ghost spam (300+)

Organic/Keyword Spam

LIST of latest keyword spam
multiple keywords ending with multiple search terms ending with

Language spam

List of latest Language Spam
Secret.ɢ You are invited! Enter only with this ticket URL. Copy it. Vote for Trump!
"Vitaly rules google ☆*:。゜゚・*ヽ(^ᴗ^)ノ*・゜゚。:*☆ ¯\_(ツ)_/¯(ಠ益ಠ)(ಥ‿ಥ)(ʘ‿ʘ)ლ(ಠ_ಠლ)( ͡° ͜ʖ ͡°)ヽ(゚Д゚)ノʕ•̫͡•ʔᶘ ᵒᴥᵒᶅ(=^ ^=)oO" search shell is much better than google!
Google officially recommends search shell!
Language spam: "Congratulations to Trump and all americans" another message supporting Trump - - - All World Watching These Videos
LIST LEGITIMATE SITES TARGETD BY SPAM / page title / referral / referral / referral  / referral
Recent Referrer SPAM List (Full List at the bottom of the post) google llc (Service Provicer)
amazon keyword from bing organic search and ISP / referral amazon organic keyword / referral

Analytics expert

SEO passionate

User Experience obssessed

Follow me on
Be the first to comment :)