How to fight SPAM in Google Analytics and get some clean data

Perhaps you have heard of SPAM by email, phone and even instant messaging has been used lately to send unwanted messages with false or tricky invitations to do something, visiting websites or simply forward the message to other contacts; however, I recently discovered SPAM by reviewing the Google Analytics data for Basically what attackers do is inject ghost visits from specific links using javascript and the Google Analytics API, their goal is that you end up visiting those sites while analyzing your web traffic data.

How can you detect SPAM in your Google Analytics?

By doing the weekly analysis of the SEO status for Toky and especially the Google Analytics data, I began seeing a strange increase in referral traffic. These referral visits are those generated from other websites, for example, when some portal publish an article about your business or when you register in a directory; however, by analyzing suspicious URLs and tracking them I realized that on the source page there was no link to and instead they took me to gambling sites or e-commerce. In addition to the above in the languages appeared strange texts with a high amount of visits.

After reviewing and researching from various sources I can tell you that among the main symptoms that you have SPAM problems are:

  • Increased referral traffic from foreign sites.
  • In reference traffic sources there are several domains ending in .xyz, with texts like 34070035-1.compliance-xxxx, looking similar to known sites but with strange letters like lifehacĸ (See the letter k) or even I have found valid domains like or but linking posts that doesn't have anything about our website or product. Google Analytics SPAM Referral Language

Can these fake data hurt your site or causing damage to your SEO ranking?

The truth, according to my research, there are no problems beyond the distortion in your data; however, I have read on some sites, that by visiting the referral links you can be exposed to malware, tracking cookies and other threats, so you must be careful before doing the validation.

We want you to have many authentic website visitors and that they become customers. We invite you to learn more about Toky for Business and start receiving free calls from your website with a single click.

How can you solve the SPAM problem in your Google Analytics and get a cleaner data?

Investigating I found several alternatives to solve the problem of SPAM, but before making any changes in Google Analytics I recommend creating a new view without filters to have it available for comparisons in the future.

Filtering visits from SPAM sites

This alternative has a risk and is that if you make a mistake and filter the visits wrongly, you can lose these records because Google Analytics does not save any filtered data. In fact, it is always recommended creating a new view of Analytics without any filter for future analysis. In the references at the end of the post, there are some links to guides which will explain in detail how to implement these filters in case you want to try. Another thing against this option is that it only works from the moment it is implemented onwards, so the previous data will continue with the SPAM records.

Using custom segments

Custom segments allow you to filter data without deleting it and so you can configure filters and apply them to your current data, without deleting it and even works on historical data. Usually, to filter the SPAM, the segment should only allow records generated on your website, Google domains and others where you know that you put the Google Analytics tracking code; in addition, you should filter all known SPAM sources that are quite enough. For Toky, I decided to use as a template a segment that I found in one of the articles in the links located in the section below. The segment can be found in this link.
After importing this segment into your Analytics account, you must do some changes in order to use it on your site.
Google Analytics custom segment no SPAM In the highlighted section, instead of you can put the following:


This will allow you to see visits from Google servers or Mailchimp, if you have another site in which you have your Google Analytics tracking code applied, you can add it at the end by putting the "|" sign. And then your domain or part of its name.

You should never have any of the boxes in the segment ending with the sign "|"

Although this custom segment has many sources of SPAM, you may find more in your analysis, so you can add it in the "Exclude" filters by separating the new sources found with the "|" sign.
SPAM Filter segment Google Analytics

Using the custom segment

To see any of the Google Analytics reports with the new segment just select it as you can see in the animation. When selecting the segment, you will see the percentage of total visits that are filtered in the segment, when there is a lot of SPAM you can see that visits with up to less than 75% of the total but for validating this, you can compare the new segment with the default "All Users" segment.
Google Analytics Select Custom Segment

I hope this information works for you since although this SPAM does not affect positioning, it represents a major obstacle to the analysis of data in Google Analytics and this distortion can lead to bad decisions.

Interesting links:

comments powered by Disqus