Referral spam? Solution & Tutorial for your Google Analytics Account and FTP / .htaccess

Referral spam from landing pages like semalt.com disturbs webmasters in their analyses, like in Google Analytics, enormously! But don’t worry, there are simple little tutorials that help to remove such spam from your own data. Already in June I wrote a small article about how to exclude spam pages via .htaccess. But since many people are working with Google Analytics, there is now a small update! I like to refer to the data of Ben Travis – who always updates the list of referral spam in his blog. There you can find all current sources of dubious visitors, respectively bots. Now to the crux: Remove referral spam in Google Analytics!

Exclude, remove and block referral spam

What is actual referral spam? I love the internet! There are new ideas everywhere, this brilliant idea is from Russia: Referral Spam. Resourceful developers create landing pages. Every small webmaster is of course happy about every backlink, look at it, lands on a landing page. Not a valuable link. No valuable visitor. Only a landing page and a bot that crawls the pages. The principle behind it is as simple as it is amazing: By cleverly linking pages, you as a website operator will of course become aware of the new, visitor sources. And of course you will risk a look at them. In the end you will end up on a simple sales page, landing page, etc. There you will find the typical affiliate offers: travel, medication, etc. So the whole trick is to get you as a webmaster on the sites and sell something. Chapeau! Great idea, really.

Whoever then wants to analyze his visitors will get falsified data, no matter if visitors, duration of visit, origin, etc. Therefore we want to exclude this spam!

Google Analytics, general filters against referral spam

Open Google Analytics Dashboard. Here we go. First open your Google Analytics account. Click on Manage > ‘Select account

referral-spam-google-anayltics-new-filters-remove-block-out-exclude-01-selection-dashboard

Add filter and enter data

Here you now add all lines of code. After each filter you have to add it to the individual website views (next but one picture):

  • Filter type: User defined
  • referral-spam-google-anayltics-new-filter-remove-block-out-exclude-02-settings-establishment-setup

    Current list of spam pages

    You can find the latest list at Ben Travis from Viget. Meanwhile there are three small lists, because Google Analytics limits the input to 255 characters in the filters.

    #1
    .*((darodar|priceg|buttons-for(-your)?-website|makemoneyonline|blackhatworth|hulfingtonpost|o-o-6-o-o|(social|(simple|free|floating)-share)-buttons).com|econom.co|ilovevitaly(.co(m)?)|(ilovevitaly(.ru))|(humanorightswatch|guardlink).org).*
    
    #2 - UPDATE
    .*((best(websitesawards|-seo-(solution|offer))|get-free(-social)?-traffic(-now)?|googlsucks).com|(domination|torture).ml|((rapidgator-)?(general) ?porn(hub(-) ?forum) ?|4webmasters).(ga|tk|org|uni)|(buy-cheap-online).info).*
    #3 - UPDATE
    .*((event-tracking|semalt(media)?|(100dollars|success)-seo|chinese-amezon|e-buyeasy|theguardlan|webmaster-traffic).com|traffic(monetize(r)?|2money).(org|com)|pops.foundation|erot.co).*

    referral-spam-google-anayltics-new-filters-remove-blocking-excluding-07-apply website data

    Add all filters, collect

    Now you have created all filters and added them to the individual website views. Perfect.

    referral-spam-google-anayltics-new-filters-remove-block-exclude-03-create multiple-filters

    Extra tip: Google Analytics: remove referral spam retroactively

    Whoever has now fixed everything to avoid being disturbed by link spam has taken the biggest step. In 30 days the standard records of the target group and visitors of the website will be ‘clean’ again. If you still want to take a look back, e.g. to analyze the current page, you can apply the filter to the current data view. You can see how to do this here. First step, click Target Group > Overview. There you add a + New Segment.

    referral-spam-google-anayltics-new-filters-remove-blocking-excluding-04-target-group-overview-filters-add

    Add filter and enter data

    Look at the screenshot of my Anaylitcs Accout. You exclude, as before, exactly the spam sources. This will ‘reduce’ your number of visitors (in the example on the right) to a real level, without bots.

    referral-spam-google-anayltics-new-filters-remove-block-exclude-05-filters-add-add-filters

    Here you do not create three individual filters, but connect all three lines of code (point 2) with an AND. Afterwards you save your filter. You can add it as a segment in every website view. For example, if you have several pages.

    referral-spam-google-anayltics-new-filters-remove-blocking-excluding-06-combining-multiple-filters

    Extra tip! Exclude the own IP (office, home, etc.)

    You still make up a large part of your visitors yourself? Your own traffic also influences the Google Analytics data. There is a great solution for this as well, you can remove your own IP (of course others as well) from the website data view. To do this, you create a general filter in Google Anayltics > Manage, just like in point 1. You assign these new filters to the individual records of the account.

    referral-spam-google-anayltics-new-filters-remove-block-exclude-08-tipp-for-proprietary-office-ip

    Now you have a small first season of great filters and much cleaner data to analyze your own website.

    referral-spam-google-anayltics-new-filters-remove-block-exclude-09-dashboard

    Exclude referral spam via .htaccess – The current list 12/2015

    Unfortunately the wrong visits falsify your statistics. Therefore it is time to do something. How you can “protect” your website from this, also on pages and shops of your customers, is explained here:

    1. Open / create your .htaccesswww.htaccesseditor.com/gr.shtml
    # block Russian referrer spam
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} ^http://.*ilovevitaly.com/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://.*ilovevitaly..ru/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://.*ilovevitaly.org/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://.*ilovevitaly.info/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://.*iloveitaly.ru/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://.*econom.co/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://.*savetubevideo.com/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://.*kambasoft.com/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://.* buttons-for-website.com/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://.*semalt.com/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://.*darodar.com/ [NC]
    RewriteCond %{HTTP_REFERER} ^http://.*best-seo-software.xyz/ [NC]
    RewriteCond %{HTTP_REFERER} ^http://.*adf.ly/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://.* get-your-social-buttons.com/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://.*rankings-analytics.com/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://.*alibestsale.com/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://.*o-o-8-o-o.com/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://.*traffic2cash.org/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://.*cyber-monday.ga/ [NC,OR]
    RewriteRule ^(.*)$ - [F,L]
    

    Done! Either way, you’re spam-free now (for now)!

    The following pages are the best known:

      em>ilovevitaly.com/ru/…
      >em>semalt.com/li>darodar.com

    You can always find updates on new spam here.
    We are looking forward to new pages!