How to Block Referral Spam

2 Methods: Create an Exclude Filter | How to Filter Language Spam in Google Analytics

What is is a referrer spam URL used to spam Google Analytics with fraudulent referral traffic. The reason why your Google Analytics account is getting spammed by referral traffic is because the spammer wants to obtain your attention and provoke you to visit the URL in your browser. referral

The spammer will utilize various tactics in order to make it look like your website received referral traffic from even though it really did not. This type of web traffic is a specific type of web traffic known as “ghost traffic.” The spammer essentially sends phantom visitors to your website’s Google Analytics account in order to make it appear as if someone visited your website from the referral URL.
what is

Referrer spammers usually target your website’s data for several reasons:

  • Referrer spammers want to promote a website and want you to visit the webpage or search for it online through Google search engine results pages.
  • Referrer spammers want to boost their rank on Google search engine results pages by creating backlinks. They do this by logging requests into your website’s access log, which is then crawled by Google’s indexing bots and seen as a backlink to the spam site.

Referrer spam is not harmful to your website, your server speed, bandwidth, ranking on search results pages, SEO, or anything like that. However, it can ruin your website’s Google Analytics data and that is why it is recommended to block it.

Create an Exclude Filter

1. Open your Google Analytics account and go to the Admin tab> Click Filters on the right side in the VIEW section.

2. Click the + ADD FILTER button to create a new exclude filter.

3. Add or something you can easily remember as the Filter Name.

4. Select the Custom Filter Type.

5. In Filter Field, find and select Campaign Source in the list. In the Filter Pattern text box, add and click the blue Save button on the bottom of the webpage. To add multiple URLs to the same filter you can make a Filter Pattern similar to this with a | between each URL: | Example\.com |

Also See: How to exclude all hits from known bots and spiders in Google Analytics (Bot Filtering)

Sean Doyle

Sean Doyle is a tech author and engineer with over 20 years of experience in cybersecurity, privacy, malware, Google Analytics, online marketing, and other topics. Sean's content has been featured in numerous publications.

3 Responses

  1. Lisa says:

    Great information! I would have the same question as Max. “will this filter our “” traffic both for historical and for data that will be collected in the future?”

    • Winston Clay says:

      Hi, Lisa.

      You’ve probably already gotten your answer by now, but in case you haven’t, Google Analytics filters do not filter past data, only data from the time of the filter’s implementation.

      You could create a Segment (Admin/View/Personal Tools & Assets/Segments) that you could then use to view data without those hits.



  2. Max says:

    Dear Sean,

    thanks a lot for the enlighting post regarding referrer spam. I have one additional question: If I add the exclude filter, will this filter our “” traffic both for historical and for data that will be collected in the future? I have added the filter and it still shows for the last month, so I wondered whether this is normal or whether I have applied to filter incorrectly.

    Looking forward to your reply,

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.