Referral Spam is a method where a someone manages to make multiple advertisement requests through a referrer URL. Even though this technique is not harmful to your website per se, it messes with your traffic statistics given the hits it produces and, therefore, an unpleasant consequence will be polluted data that will affect the vision you need to obtain when working with Google Analytics to improve your online business.

Polluted data affected by referral spam

AliBestSale is an online store that sells different kinds of stuff. Under the name AliExpress, this is actually a legitimate website and it’s not directly responsible for spamming your data. However, at this moment, it’s being used by spammers as described before.


In order to stop this and other Referral or Ghost Spam, we’ll explain how to create a filter in Google Analytics to exclude it:

  • Make sure you’re on the right Account.
  • Click on the Admin menu
  • In the View column on the right, select option Filters, click on Add Filter and choose a name for it.
  • Set Filter Type to Custom and on Filter Field select Campaign Source.
  • On the Filter Pattern box type the expression| Save changes.

Referral spam configuration

It should take a while for the filter to show results. Now, it’s time to clean our historical data given that there are already records affected by the spammer:

  • Make sure you’re on the right Account.
  • Select the Reporting tab and visit Acquisition > All Traffic > Referrals
  • Select Add Segment and then click on the New Segment button. Choose a name for the segment.
  • Click on Conditions and change the filter option to Exclude.
  • Set the Ad Content option as Acquisition > Medium, the Contains field as exactly matches and for the text box choose referral.
  • Select the AND option, set the Ad Content option to Acquisition > Source, the Contains field as matches regex
  • Type the expression|| Save changes.

Segment referral report

That should be it, you must follow-up on your traffic data statistics for a few days to confirm the issue was solved. In case you are unable to create or edit view filters check a solution we provided on our post: Can’t create or edit view filters for a Google Analytics account.

This solution works too for referral spam as and others:

  • video–



Please enter your comment!
Please enter your name here